Gutenberg-mobile: Uploading new image "overwrites" different image

Created on 12 Feb 2020  路  2Comments  路  Source: wordpress-mobile/gutenberg-mobile

Describe the bug
On Android, when an image in a post has a remote id (for example, 12) that conflicts with the local id assigned to a newly added image, upon completion of uploading the newly added image, both of the images with the matching id (12) will be overwritten with the newly added image.

To Reproduce
Steps to reproduce the behavior:

  1. Open a post with an image block with an image that has a remote id 1 greater than the last local id.
  2. Add a new image block to the post
  3. Add an image from the device to the image block (so it will be assigned a local id matching the remote id of the already-present image block)
  4. Observe that both images are updated visually and that they html for both blocks reflects the newly added image

Expected behavior
Adding an image to an image block should not affect the images in any other image block.

Screenshots
overwrite_image mp4

Smartphone (please complete the following information):

  • Device: Pixel 2 emulator
  • OS: Android 10

Additional context
This is sort of the flip-side of the problem seen in #1853 , which was also due to conflicting image ids (see also https://github.com/wordpress-mobile/WordPress-Android/issues/11239).

I believe this is very much an edge case issue as compared to #1853. That issue only required that you have a local id that conflicted with the remote id of _any_ image in your media library. This issue, by contrast, requires that you have a local id that conflicts with the remote id of an image that has been included in the post you are editing.

[OS] Android [Type] Bug

Most helpful comment

User report of a similar sounding issue:

User on Android mobile app and in a post with a lot of images in image blocks, when they tried to replace one image, it was replacing others in the post with that same image.

3580046-zd-woothemes

All 2 comments

I have reproduced this, and have confirmed this also occurs with other blocks. Any block that uses MediaUploadProgress component will respond to events filtered by id, so this indeed results in the duplicated progress bar indications, as well as incorrect replacement of the media items upon receiving the upload completion event.

User report of a similar sounding issue:

User on Android mobile app and in a post with a lot of images in image blocks, when they tried to replace one image, it was replacing others in the post with that same image.

3580046-zd-woothemes

Was this page helpful?
0 / 5 - 0 ratings