Wordpress-android: Local media ids can collide with remote ids

Created on 5 Feb 2020  路  5Comments  路  Source: wordpress-mobile/WordPress-Android

Description

The local media ids used for not-yet-uploaded media files can collide with remote ids of items in the WordPress Media Library. In most cases, this should not cause a problem, however, situations may exist where the id conflict poses an issue. In particular, we currently deduplicate media items within the gallery block keyed on id, so this could affect user experience for a user uploading new items with local ids that match the ids of items already added.

This issue was previously noted here: https://github.com/wordpress-mobile/gutenberg-mobile/issues/1610

There is a potential solution to this issue here: https://github.com/wordpress-mobile/WordPress-Android/pull/11125, but this may require further investigation to explore alternative solution(s) (another possible solution is mentioned in the PR description).

Update:

This issue has been confirmed to be related to and a possible root cause of https://github.com/wordpress-mobile/gutenberg-mobile/issues/1853.

:1st_place_medal: Thanks to @cameronvoell and @mchowning:

Steps to reproduce the behavior

  • Add an image block and choose to add an image from the media library
  • Scroll down to add the earliest image in library
  • Switch to html mode and note the id of that earliest image (e.g. "id": 8)
  • Close the app, and clear app storage and cache
  • Sign back into the app and open a new post
  • Repeat the following ([noted id] - 1) times (e.g. 7 times):

    • Add an image block

    • Add an image via "Choose from device" (can be with airplane mode on, which may be quicker)

  • Add another image block
  • Turn airplane mode off and add an image via "Choose from device"

Expected:

  • Upload progress will show the correct image dimmed with a progress bar

Actual:

  • The placeholder will show the correct image at first
  • The placeholder then shows a generic background (light gray)
  • The placeholder then shows the incorrect image (the media library image with the noted id, e.g. 8)
  • The placeholder finally shows the correct image after the upload completes
Media [Type] Bug gutenberg-mobile

Most helpful comment

All 5 comments

Was this page helpful?
0 / 5 - 0 ratings