Page MenuHomePhabricator

Uploading a duplicate file causes spinner to spin forever
Closed, ResolvedPublic

Description

Uploading a file that already exists on the wiki causes the spinner to spin forever. The API request comes back with /something/ but Firebug is being a PITA and won't show me the response contents.

Observed on commons.prototype.wm.o/uwd


Version: unspecified
Severity: normal

Details

Reference
bz26081

Related Objects

Event Timeline

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

It just so happens that mw.iFrameTransport.js line 94 uses a temporary variable called json without declaring it, which results in it leaking into the global scope. This is bad style, but allowed me to get the server's response:

json

"{ "upload": { "result": "Warning", "warnings": { "exists": "Badtoken.png" }, "sessionkey": "frex7j7se8avvfo2pmmt5t643h10zki" } } "

Upon casual reading of the code, it looks like mw.UploadWizard.js lines 229-233 seem to be the culprit, along with a comment acknowledging the issue.

neilk wrote:

*** Bug 26007 has been marked as a duplicate of this bug. ***

I haven't looked at the code yet, but you can check if a file already exists on commons by running a hash check through the API. If ?action=query&list=allimages&aisha1=<imagehash> returns any matches, you can discard the upload and return an error message.

neilk wrote:

see above comment, fixed in r84223