Last modified: 2013-04-22 16:16:54 UTC
The sha-1 based duplicate check which should return a friendly "This file was previously uploaded" message on the first step is no longer working in (recent) Firefox/Chrome versions. It's still working in Opera, oddly enough. The upload will still be rejected with at least a human-readable error message in the final step.
The reason it's working in Opera is because ApiUploadHandler doesn't set the ignorewarnings field, and we just made sure it would use that in a recent bug fix. Apparently, when ignorewarnings is set, the hash check is either not performed or not reported for some reason. So, we could either unset ignorewarnings for FormDataTransport browsers, or we could set ignorewarnings for ApiUploadHandler browsers. In the former case, we lose some of the flexibility for title-related errors, which could be fixed in the Details step of UW. In the latter case, we lose any capacity to act on the hash check in the first step, but at least we're consistent. The third option is to debug core and figure out why the hash check isn't performed when ignorewarnings is set and the duplicate filename error is already present (try renaming a file you've uploaded before, chrome and firefox will complain then). I'll start into this now, because both of the above options have major drawbacks.
Ha! Got it. FormDataTransport wasn't using the same trick as the HTML form, adding the timestamp to the filename to avoid duplicate warnings. The server will only return 'duplicate' if there are both, so avoiding the harmless one is important on the first step. Patch. Patch need review. Patch here: https://gerrit.wikimedia.org/r/8937
Merged to trunk.
Confirmed fixed in master.