wordpress-mobile / wordpress-mobile/WordPress-Android

Duplicate media on upload after retry

Open
#13,427 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

[Pri] Medium [Type] Bug groundskeeping Media
Dominant language
Kotlin
Stars
3.2k
Forks
1.4k
Avg merge
1d 11h
Merged PRs (30d)
69

Description

Expected behavior

Retrying upload for a previously upload failed image should not result in duplicate images in the media library.

Actual behavior

If you upload more than one images at once and upload fails for an image, then on retrying to upload makes duplicate copies in the media library.

(Tested on a self-hosted site. Might also be reproducible on a simple WP site.)

Steps to reproduce the behavior
  1. Launch app
  2. Open a draft post in the Gutenberg Editor
  3. Select image block
  4. Select more than one images for upload
  5. Enable airplane mode, wait for ~1 min and then disable it while images are uploading so that images upload fails for at least one of the image (I also re-surfaced the app from background once)
  6. Click retry on the failed image
  7. Wait for the upload to complete
  8. Go to media library and notice duplicate copy of the failed image

Attempt 1: https://cloudup.com/izjkk0AITDc (Duplicate media on timestamp 1:14)

Attempt 2: https://cloudup.com/iydwecO-FxC (Duplicate media on timestamp 1:53)

Tested on [Pixel3 API 27], WPAndroid [16.2-rc-1]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the multi-image upload flow in the Gutenberg Editor using the listed airplane-mode interruption, then trace the retry path for the failed image and its media-library result. Done means retrying a failed upload no longer creates a duplicate image.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.