Skip to content

Uploading new image "overwrites" different image #1896

@mchowning

Description

@mchowning

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 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.

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 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions