Page MenuHomePhabricator

[BUG] Deal more helpfully with users who do not have the reupload right
Open, Needs TriagePublic5 Estimated Story PointsBUG REPORT

Description

What is the problem?

If logged into SVGTranslate with a user who does not have reupload rights on Commons, when attempting to upload a translation the user sees:

500: Internal Server Error

A file with this name already exists, and cannot be overwritten. If you still want to upload your file, please go back and use a new name. [[File:2D_Polar_2.svg|thumb|center|2D_Polar_2.svg]]

It is not necessarily obvious to the user what the problem is.

According to https://commons.wikimedia.org/wiki/Commons:Autoconfirmed_users, on Commons users do not have the reupload right until their account is over 4 days old. If a user creates an account especially to use SVGTranslate, they may hit this problem and not know what to do.

A new user could still upload their own SVG file and submit translations to it, as this is determined by a different right: reupload-own.

Solutions

...might be tricky as I believe the above error message is returned from MediaWiki.

Moreover, SVGTranslate is not aware of which rights a user has.

However, perhaps it could find out through the API? Then show its own error message. Or prevent the user from uploading, telling them why and how to rectify it (e.g. ask an admin to give them the right).

Steps to reproduce problem
  1. Create a new user on Commons
  2. Find an SVG file on Commons
  3. Attempt to upload a translation

Expected behavior: A helpful error message. Or, perhaps the user is prevented from uploading and told why.
Observed behavior: The above error message.

<Aside>

Apart from the above, there are a number of other reasons a user might not be able to upload a translations. I have investigated a couple of others. So far, the behaviour seems reasonable, as the user is informed more precisely what the issue is. There are probably more to investigate.

If a user is attempting to upload a translation to a protected file, they see:

500: Internal Server Error
This page has been protected to prevent editing or other actions.

If attempting to translate a file while blocked from editing, they see:

500: Internal Server Error
You have been blocked from editing.

Event Timeline

Hello,

I want to upload a translated svg but cannot and get this same exact error ("A file with this name already exists, and cannot be overwritten. If you still want to upload your file, please go back and use a new name. ..."), and may account is well over 4 days old.
The file is "Referendum_France_1969.svg": what can I do to succeed ?

Regards,

Hello,

I want to upload a translated svg but cannot and get this same exact error ("A file with this name already exists, and cannot be overwritten. If you still want to upload your file, please go back and use a new name. ..."), and may account is well over 4 days old.

@Jmwpf It might be because your account on Commons is not yet 4 days old (see https://meta.wikimedia.org/wiki/Special:CentralAuth?target=Jmwpf). Commons is where you will be reuploading the file, and so you need to have autoconfirmed rights on Commons.

Please try again in a couple of days. Alternatively, if you would like it quicker, I believe you should request the "Confirmed" right via this link https://commons.wikimedia.org/wiki/Commons:Requests_for_rights.

If you have any more problems with this, please let us know.

No problem. I will just wait a couple of days and retry.

Just waited and retried. It worked.

Since SVG Translate is solely about uploading new versions of files, we could do the permissions check when they first login. If they're missing the reupload permission we could reject the login and show a helpful explanation like Dom did at T231075#7056312. I'm thinking we shouldn't allow users to waste their time translating if they're unable to save their work.

Samwilson set the point value for this task to 5.Apr 12 2023, 11:18 AM
Samwilson moved this task from New & TBD Tickets to Up Next on the Community-Tech board.

@dom_walden do we need any designs to serve up a more useful error message? I'm not sure if there are any existing patterns we can leverage

@dom_walden do we need any designs to serve up a more useful error message? I'm not sure if there are any existing patterns we can leverage

We might need designs. I cannot think of any existing patterns off the top of my head, but the design team might know.