Skip to content

Remove mMediaMarkedUploadingOnStartIds from EditPostActivity #9377

@mzorz

Description

@mzorz

The code involved in keeping mMediaMarkedUploadingOnStartIds was used a while ago to keep track of possible changes to a Post.

We don’t need to keep the list of “uploading media” as we were doing in Aztec, as that was just an artifact to detect changes in a Post (as in when an upload finishes and the Post is updated with the final URL, for example). In fact, it was an old way to detect changes as we were relying on Aztec’s history first, and then switched to also take media uploads in consideration in #6655, but nowadays we calculate a hash on the content so the check is not needed anymore in Gutenberg (and, in Aztec I’d say as well, but haven’t tested).

How to test it works fine in Gutenberg (where these specific uploading media checks are not being done):

  1. start a draft
  2. add an image block and choose an image from the device to upload
  3. tap back while it's uploading
  4. open the post in the editor again while it has not yet finished uploading
  5. just sit and wait
  6. once it's finished, tap back
  7. observe it was correctly saved and updated on the web.

This is the exact case that code was trying to cover, and is not needed in Gutenberg as per the reasons explained above.

cc @hypest

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions