Page MenuHomePhabricator

UploadWizard unable to override "similar name"/"same name" detection warning
Closed, ResolvedPublic

Description

Author: davidrichfield

Description:
When I try to upload an svg version of a file that is already on commons, the new "same name" detection completely prevents me from uploading it. This restriction needs to be relaxed.


Version: master
Severity: major
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=59203
https://bugzilla.wikimedia.org/show_bug.cgi?id=70617

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Seems to be introduced in I21eddc5d08ca3c23b3 / bug 40326

(In reply to comment #4)

Seems to be introduced in I21eddc5d08ca3c23b3 / bug 40326

It seems to me that this should be a "recoverable warning" (By which I mean you ask the user if they are sure, and then let them do it if they really want to). Does that sound right?

davidrichfield wrote:

That would solve my problem, and I guess it would still avoid the problem in Bug 40326.

This would also allow a user to make an intelligent choice, for example if I want to upload steroidogenesis.svg and there's already a steroidogenesis.png, I can either keep the filename if I'm just making an svg version of the png, or change the name if it's a completely different picture.

(In reply to comment #5)

this should be a "recoverable warning"

Recoverable only if it has a different file extension/type. Uploading Foo.JPG and Foo.jpg should be still impossible (as some file systems do not like this; Just imagine, their MD5 would start with the same byte).

kevjonesin wrote:

Recoverable with a different file extension/type sounds good to me.

I'd recently added transparent backgrounds (alpha channels) to some .jpg images via [[GIMP]] and was a bit irked/befuddled when I'd entered info for multiple .png versions I was uploading simultaneously via UploadWizard only to get denied at the end. At the very least it would be nice if the filename denial had come nearer the start of the process. Of course a "recoverable warning" would make this moot... well, perhaps not... it would still be nice to get warnings regarding filenames as soon as the file name is entered via the file browser. Before going through additional steps.

Advance 'tanx' goes out to those with the skillz, : }

kevjonesin wrote:

p.s. I'm...
[[User:Kevjonesin|Kevjonesin]] ([[User talk:Kevjonesin|talk]]) 22:58, 28 May 2013 (UTC)
...on English Wikipedia.

Bryan.TongMinh: Could you take a look at this, as https://gerrit.wikimedia.org/r/#/c/24124/ was written by you? Thanks.

Please fix this bug or revert the initial commit. This should not stay the way it is now.
FYI: I wasted some hours with debugging some python script because I could not upload a WebM file. Some minutes ago I realized another file was already uploaded with the same name (totally unrelated) with PNG extension.

Even if there are two related files like "animal123.png" & "animal123.webm" the error should not show up!

Is this still an issue on commons. (I was going to review your commit [Sorry about letting that fall through the cracks] today), but I couldn't reproduce the issue locally. Although it may be me just getting a little sleepy and doing something stupid

(In reply to comment #12)

Is this still an issue on commons?

Jup!

Related Patch set:
Change 87020
Change-Id I1a98bf43284b5045b1ee6c60e64075404fd0a837

https://gerrit.wikimedia.org/r/#/c/87020/

(In reply to comment #13)

(In reply to comment #12)

Is this still an issue on commons?

Jup!

Really, because I was able to successfully upload https://commons.wikimedia.org/wiki/File:Carngranny_level_crossing_-_geograph.org.uk_-_274643.png even though https://commons.wikimedia.org/wiki/File:Carngranny_level_crossing_-_geograph.org.uk_-_274643.jpg exists

It is not possible for me to use the UpWiz which gives me:

There is [/wiki/File:Carngranny_level_crossing_-_geograph.org.uk_-_274643.webm another file] already on the wiki with the same filename

in red textcolor regardless of me clicking on "Retry failed uploads".

Also youtube2mediawiki gives "Upload failed."

(In reply to comment #16)

It is not possible for me to use the UpWiz which gives me:

There is
[/wiki/File:Carngranny_level_crossing_-_geograph.org.uk_-_274643.webm
another file] already on the wiki with the same filename

in red textcolor regardless of me clicking on "Retry failed uploads".

Also youtube2mediawiki gives "Upload failed."

I would view that as an upload wizard bug in that it doesn't allow people to bypass warnings. It seems kind of silly to me to get rid of all non-critical warnings because upload wizard is not giving the option to the user to ignore them

(In reply to comment #17)
Makes sense, actually. I guess we better file a new bug as this one is quite stuffed?

(In reply to comment #18)

(In reply to comment #17)
Makes sense, actually. I guess we better file a new bug as this one is quite
stuffed?

Although it appears that originally this happened for Special:Upload too, We could probably just move this bug to uploadWizard component.

I guess we could add in a check to ignore the filename exists error if they're not actually identical - i.e. the extension is different. That sounds fine to me. As long as we warn the user in the description step.

Changing importance: This is not an "enhancement" but a major bug displeasing uploaders for months now.

Just two more examples:
https://commons.wikimedia.org/w/index.php?oldid=103108315
https://commons.wikimedia.org/w/index.php?diff=111356217

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

(In reply to comment #21)

I guess we could add in a check to ignore the filename exists error if they're
not actually identical - i.e. the extension is different. That sounds fine to
me. As long as we warn the user in the description step.

What would you like to "warn the user about"?

mtraceur: Could you answer comment 24 please?

Well, I would definitely like to tell the user that they're creating a potentially confusing filename. I won't make it *fatal*, but there should be notice of some sort.

(In reply to Mark Holmquist from comment #26)

Any progress? Or can I author a patch?

(In reply to Rainer Rillke @commons.wikimedia from comment #27)
Please do. :)

Regardless whether you decide to include a warning or decide to drop them... Everything is better than the current state which blocks "valid" uploads and confuses uploaders.

This also causes problems with PNG/JPEG versions - JPEGs display better, but are lossy, so, with scans and restorations it's pretty normal to have both a JPEG and PNG. Up until recently, it was at least possible to upload both at once, it's blocked now.

(By which I mean that the recent patch actually made the uploads ''more'' restrictive.)

It looks like no work has been done on this, I'm going to try to whip up a patch now.

Change 159625 had a related patch set uploaded by MarkTraceur:
[WIP] Add override button back in

https://gerrit.wikimedia.org/r/159625

This is WIP because the issues with the prior patches still exists. I guess we need to finish refactoring before we can have any real solution here.

*weeping in the corner*

@all @MarkTraceur Is there any progress with doing the refactoring and then applying the patch?

@MarkTraceur Is there any progress with doing the refactoring and then applying the patch?

If not, please add a blocking task for clarity.

I'm going to try untangling these issues this week.

matmarex renamed this task from UploadWizard unable to recover from warnings to UploadWizard unable to override "similar name"/"same name" detection warning.Sep 9 2015, 4:46 PM
matmarex removed a project: Patch-For-Review.
matmarex set Security to None.

T106968 has been merged into this bug incorrectly, this is a different issue that had incorrect title.

matmarex changed the task status from Open to Stalled.Sep 9 2015, 5:05 PM

I was unable to reproduce this issue locally.

I uploaded a file called "add.png" to my wiki:

Then I separately uploaded another file, "add.svg":

Both files went through and I did not even get any warnings.

Is this still reproducible on Commons? (Please only stick to this particular issue of similar names being blocked; there are some other ways for an upload to break due to file names, that I'm debugging and tracking this work on T106968.)

Is this still reproducible on Commons?

4 minutes ago:

Screenshot from 2015-09-11 10-19-45.png (350×959 px, 37 KB)

Okay, but that's https://commons.wikimedia.org/wiki/File:Carngranny_level_crossing_-_geograph.org.uk_-_274643.jpg , and it looks like you're trying to upload another JPG file on top of it. Reuploading the same file with UploadWizard is currently not supported, per T42893: UploadWizard cannot replace existing files. This task (as I understand it, please correct me if I'm wrong) is about problems uploading a new file whose name differs from an existing one only at the extension.

matmarex changed the task status from Stalled to Open.Sep 11 2015, 5:16 PM

Thank you, I can reproduce now. Turns out that there is a separate issue where this warning (exists-normalized) is unintentionally suppressed by the warning about target file being previously uploaded and deleted (was-deleted), and that was preventing me from seeing it.

Change 237725 had a related patch set uploaded (by Bartosz Dziewoński):
UploadBase: Return 'was-deleted' warning in addition to 'exists-normalized', not instead of

https://gerrit.wikimedia.org/r/237725

The patch above only fixes the was-deleted issue, it doesn't resolve this bug yet.

This is less than trivial because the same warning code exists-normalized is used both for cases where trying to upload "Foo.jpg" clashes with "Foo.ogg" and cases where it clashes with "Foo.JPEG". We want to allow the former and not the latter, and for that we need to share the list of "synonym" extensions between JS and PHP code, and we should probably make it reusable, and so on.

Change 237732 had a related patch set uploaded (by Bartosz Dziewoński):
mediawiki.Title: Add normalizeExtension method

https://gerrit.wikimedia.org/r/237732

Change 237740 had a related patch set uploaded (by Bartosz Dziewoński):
Do not claim that a file with given name already exists if the extension differs

https://gerrit.wikimedia.org/r/237740

Change 237741 had a related patch set uploaded (by Bartosz Dziewoński):
Allow uploading files with the same name but different extension at once

https://gerrit.wikimedia.org/r/237741

Patches required to fix this issue:

Patches that improve the behavior in some corner cases:

Change 237732 merged by jenkins-bot:
mediawiki.Title: Add normalizeExtension method

https://gerrit.wikimedia.org/r/237732

Change 237740 merged by jenkins-bot:
Do not claim that a file with given name already exists if the extension differs

https://gerrit.wikimedia.org/r/237740

Change 237741 merged by jenkins-bot:
Allow uploading files with the same name but different extension at once

https://gerrit.wikimedia.org/r/237741

Change 237725 merged by jenkins-bot:
UploadBase: Return 'was-deleted' warning in addition to 'exists-normalized', not instead of

https://gerrit.wikimedia.org/r/237725