Wordpress-android: Post List: On retry media upload sometimes fails but the post gets published

Created on 24 Apr 2019  路  5Comments  路  Source: wordpress-mobile/WordPress-Android

Expected behavior

When uploading media fails, clicking on Retry button will upload the media and upload the post.

Actual behavior

When uploading media fails, clicking on Retry button sometimes uploads the post, but the media are not uploaded. Actually it appears the media got uploaded, as they are displayed in the app, but the path to the file isn't correct -> it contains path to the local file eg. "/storage/emulated/...".

Steps to reproduce the behavior

  1. Click on create post button
  2. Enter a title
  3. Set Network to GPRS on the emulator
  4. Add an image from the local storage
  5. Click on Publish
  6. Restart the app - Kill it so even the services are killed (swiping it away from the recent apps view isn't enough - I use adb plugin)
  7. Go to My Site -> Post list
  8. Notice "error uploading media" label is shown
  9. Set Network back to LTE
  10. Click on retry
  11. Wait until the upload completes
  12. Open the post
  13. Switch to html view
  14. Notice the path contains a path to the local storage

retry-media-upload

Tested on [device], Android [version], WPAndroid [version]

Emulator API 27

Post List PostinEditing [Type] Bug

All 5 comments

Possibly related to #9804.

I spent way too much time trying to debug this :)

Some notes:

Theory: that bug can't happen now with #9859 merged because image ids are correctly associated to the failed upload post, so when we hit retry, media uploads are re-tried and the post upload will fail if the media aren't uploaded. This prevent a post to be published with failed media. Prior to #9859 it was possible because image ids were not correctly associated to the post in certain cases (multi selection in the editor).

I'm closing this ticket, but feel free to re-open.

This issue will get most probably fixed in https://github.com/wordpress-mobile/WordPress-Android/pull/10079#issuecomment-510037492

Was this page helpful?
0 / 5 - 0 ratings