Skip to content

Conversation

@leandroalonso
Copy link
Contributor

@leandroalonso leandroalonso commented Dec 19, 2019

Fixes #12282

To test

  1. While offline, run the app
  2. Create a new post and an image
  3. Tap "..." > "Save as Draft"
  4. Add another image
  5. Go back online, everything should work :)

(If you follow these steps in develop the app will crash)

Additional information

As @etoledom mentioned the problem is not only related to Media. What was happening is that PostCoordinator was deleting a revision being used by the Editor. This caused a lot of trouble.

The idea of this PR is to remove this deletion from PostCoordinator so this problem will not happen anymore. This logic is now in the Editors.

However, you can see the content in the editor blinking when the content is updated. I wonder if this is a bad experience, if it is, I'd suggest closing the Editor when the user tap "Save as Draft". I'm open to suggestions too. :)

PR submission checklist:

  • I have considered adding unit tests where possible.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

Since PostCoordinator is a entity that runs on background, it might end deleting a revision that is being used in the Editor, for example. We want to avoid that.
When saving a post and keeping the Editor opened, we need to apply the revision and update the post reference.
@peril-wordpress-mobile
Copy link

You can trigger an installable build for these changes by visiting CircleCI here.

Copy link
Contributor

@diegoreymendez diegoreymendez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR looks good on my end. I wasn't able to cause the crash or cause any inconsistencies in the post status. Good work @leandroalonso !

@leandroalonso leandroalonso merged commit a59c814 into develop Dec 20, 2019
@leandroalonso leandroalonso deleted the issue/12282_do_not_delete_revision_outside_from_editor branch December 20, 2019 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash editing/ adding media after failed upload

3 participants