Describe the bug
Close/Re-opening a page with ongoing image uploads in a Gallery Block causes the image to be marked for retry.
To Reproduce
Steps to reproduce the behavior:
Error: Image gets locked into a mode where it's tagged to be uploaded
Expected: Image should upload successfully and reflect the proper state.
https://github.com/wordpress-mobile/test-cases/blob/master/test-cases/gutenberg/gallery.md#tc001
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots

Smartphone (please complete the following information):
Additional context
Discovered during regression testing for Release 1.23.0
What happens when we dismiss the retry dialog? Does it complete successfully?
For me when the app was uploading a new page and a new image it was just hanging on the upload for a new page and never completing (waited for a few minutes). However, if I can fix this issue by:
1) Tap the image
2) Select Retry
3) Tap the image
4) Select Cancel
5) Back out to Site Pages
Then the page uploads successfully. Just revalidated a few flows and this looks like it's an issue on other media blocks as well not just gallery.
I can repro this with the same apk on Android(Huawei p20 lite, Android 9.0):
Expected:
Reality:
After performing the steps in the previous comment, in the notification center, I see the Uploading dialog for "1 page and 1 file."

To fix this apparent lock between the media uploader and the page publish, you can do one of the following:
Possible fixes are:
A) restart the phone
B) Click on the image and remove (either via remove on retry prompt or retry and cancel)
C) Loose network through airplane mode or wifi and get the network back. Then go back to site pages
Any of those seem to allow the page to upload successfully.
Also worth noting in the HTML view of the page, you'll see a local URL for the media. However, in my case, when I went to https://wordpress.com/media/{site name}, then I saw the image had successfully uploaded.
So far, I verified the bug was not in initially could not reproduce this Bug in WPAndroid release 14.1 but I could reproduce it in WPAndroid 14.2.
Looks like the new behavior actually started with the React Native upgrade (can reproduce on this commit, but not on the 14.1 release). Rather than running through those updates (too much :-P) to see what broke it, I'm just going to debug the upload code and see if we can get a fix.
Hi @chipsnyder :wave: ,
Thanks for testing this flow on the release. I was unable to reproduce this issue, following the same steps. I tried on:
12fbfd07886f166a5f710120c0619096037818d6 w/ metro onvia Pixel 3a (Android 10).
In all cases, I observed the expected behavior for this flow, so perhaps there is some subtle difference in our actions to arrive at different results (or maybe some race condition)?
Here is a screencast of my test:

Can you see whether anything is different about the flow I used?
Hey @mkevins, In your gif, it looks like you might be creating a new post instead of a new page. Try creating a new page instead. In my testing posts were fine, but pages had problems.
Reality:
The post displays white screen until the upload is complete(the upload is observable on device's status bar only)
@mkevins @chipsnyder I definitely was seeing the issue with Posts also, and I think Pinar was too, unless the above was a mistype.
Still not sure why Matt is not producing the issue, his steps look the same as mine. I did have to switch to slower mobile network and larger photos to make sure I was not loading too fast when switching back and forth. But the loading bar in Matt's video seems to show that the image is still loading, so not sure why he is not seeing the issue.
Right, I tried with a post as well.
I'm seeing the following in my testing:
In the scenario where the upload finishes _after_ the post has been reopened in the editor (4c), I did not observe any UI indication that the upload was still in progress with _image blocks_. _Gallery blocks_, on the other hand, did have the upload progress bar as like in @mkevins comment and gif.
I recreated this issue on the 14.1 release (the only other release I tested), so this does not appear to me to be a new regression.
I could not recreate this issue on iOS because iOS appears to block the user from reopening a post while it is in the process of being uploaded.
Should be resolved with associated PRs
Most helpful comment
Should be resolved with associated PRs