Upload: drop duplicate images and display warning in normal selector#6772
Open
Akul-Tyagi wants to merge 1 commit intocommons-app:mainfrom
Open
Upload: drop duplicate images and display warning in normal selector#6772Akul-Tyagi wants to merge 1 commit intocommons-app:mainfrom
Akul-Tyagi wants to merge 1 commit intocommons-app:mainfrom
Conversation
|
✅ Generated APK variants! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6771
The Problem
In the normal selector flow, duplicate content images (files sharing the same content hash) were silently passed through to the upload screen with no deduplication or user notification. This could result in redundant uploads to the Commons server and created an inconsistency with the custom selector, which already performs duplicate detection (see issue #6764 / PR #6765 ).
The Solution & Justification
I updated the normal selector's completion flow in
ContributionController.ktto:This brings the normal selector's duplicate handling to full parity with the custom selector fix in #6765 , and ensures a consistent, transparent experience across both upload flows.
Alternative Solutions Considered
I considered passing duplicates through and only showing a warning (preserving the count), similar to what was initially proposed in #6765 . However, per the direction established in #6765 , dropping duplicates and warning the user is the correct approach, as duplicate uploads are genuinely unhelpful and should be prevented at the source rather than silently permitted.
Testing Performed
betaDebugvariant successfully.:app:testBetaDebugUnitTest --tests "fr.free.nrw.commons.contributions.ContributionControllerTest"Videos
Before:
Screen_Recording_20260321_181700_Commons.mp4
After:
Screen_Recording_20260321_181512_Commons.mp4