Page MenuHomePhabricator

UploadWizard duplicate image content (hash) check is broken
Closed, ResolvedPublic

Description

Author: neilk

Description:
Duplicate checking suddenly isn't working.

This may be related to recent changes to the Title::verifyTitlePermissions() API.


Version: unspecified
Severity: normal

Details

Reference
bz28320

Related Objects

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:25 PM
bzimport added a project: UploadWizard.
bzimport set Reference to bz28320.

neilk wrote:

This bug is only hit if you are trying to upload a file with both the same filename and the same content.

The problem is that the API returns only one error at a time. It believes that same-filename error is more important, so it returns that one. Conversely, we believe that same filename isn't important yet (since we plan to surface that problem later), so we ignore it.

Solution?

  • swap the priority of those messages in the API ?
  • give the API some placeholder random filename for now so same-filename isn't even triggered at this point? We suppress the error if it occurs anyway.

We could check for same hash separately:
api.php?action=query&list=allimages&format=json&aisha1=<hash>
...and make sure the number of matches is 0.

neilk wrote:

fixed in r85683

used placeholder semi-random filename