Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AutoUpload only publishable local drafts #9962

Merged
merged 1 commit into from
May 31, 2019

Conversation

malinajirka
Copy link
Contributor

@malinajirka malinajirka commented May 30, 2019

Fixes #9955

LocalDraftUploadStarted doesn't automatically upload local drafts which are not publishable.

To test:

  1. Turn on Airplane mode
  2. My Site -> Blog Posts
  3. Create a Post
  4. Enter a title
  5. Press back
  6. Open the post
  7. Remove the title
  8. Press back
  9. Turn off airplane mode + you can also pull to refresh
  10. Notice the failed upload notification isn't shown
  11. Turn on airplane mode
  12. Create a local draft
  13. Turn off airplane mode
  14. Make sure the second local draft gets uploaded - in other words make sure the "unpublishable" draft doesn't block all uploads

Update release notes:

  • The feature hasn't been released yet + the changes are too minor

Before/After gifs
repeating-failures

fixed-repeating-failures

@malinajirka malinajirka added this to the 12.6 milestone May 30, 2019
@malinajirka malinajirka requested review from maxme and shiki May 30, 2019 13:32
Copy link
Member

@shiki shiki left a comment

Choose a reason for hiding this comment

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

@malinajirka, the code looks good to me. I just wanted to confirm if you're seeing this bug. The changes cause duplicate Post uploads for me. I followed the testing steps that you mentioned.

This is on an emulator, Nexus 5X, Android 9.

I can't quite figure out why. If I remove the new filter { } that you added, the upload seems to be okay. I think this means we'll have to add concurrency protection in LocalDraftUploadStarter. 🤔

Feel free to merge if it is not related. We can create a new issue for it.

@maxme
Copy link
Contributor

maxme commented May 31, 2019

@shiki I wasn't able to repro the bug, maybe I missed a step:

9962-2

I wonder if it comes from somewhere else (and we should open a ticket for it), maybe we enqueue the same upload twice (I don't remember where we check for an existing upload)? could be a race condition?

@shiki
Copy link
Member

shiki commented May 31, 2019

@maxme I was able to condense the steps and can somewhat consistently reproduce it even without the new filter. I added the steps in this comment on an existing issue #8594.

I'll merge this since this is not the cause.

@shiki shiki merged commit 116c454 into develop May 31, 2019
@shiki shiki deleted the issue/9955-auto-upload-only-publishable-drafts branch May 31, 2019 16:02
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.

Don't trigger remote auto-upload on unpublishable local drafts
3 participants