-
Notifications
You must be signed in to change notification settings - Fork 57
Uploading new image "overwrites" different image #1896
Description
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:
- Open a post with an image block with an image that has a remote id 1 greater than the last local id.
- Add a new image block to the post
- 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)
- Observe that both images are updated visually and that the 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.
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 wordpress-mobile/WordPress-Android#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.
