Page MenuHomePhabricator

[BUG] Do not upload file if there are no translations added
Closed, ResolvedPublic2 Estimated Story PointsBUG REPORT

Description

This happened twice on this file but no translations were added.

Keep the Upload to Commons button disabled unless one or more input labels have text entered by user.

Event Timeline

Niharika triaged this task as Medium priority.Feb 15 2019, 12:13 AM
Niharika created this task.
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Niharika set the point value for this task to 2.Feb 20 2019, 12:41 AM
Niharika moved this task from To Be Estimated/Discussed to Estimated on the Community-Tech board.
MBinder_WMF changed the subtype of this task from "Task" to "Bug Report".Mar 28 2019, 11:12 PM

The file is getting uploading to commons after pressing ENTER key without complete translation. The file gets uploaded to commons as soon as the ENTER key is pressed after filling first translated word.

When I first visit the tool (or after refreshing the page), the "Upload to Commons" but is enabled. I can click it and I get:

500: Internal Server Error
The upload is an exact duplicate of the current version of [[:File:Osmotic pressure on blood cells 20190220211300.svg]].

Thanks @dom_walden.

@MaxSem Instead of a 500 error, we should not show the user anything at all and keep them on the translations page. I'd prefer the button to be disabled if we're not adding anything new but I know that's more tricky.

I've just released 0.8.0, containing code relating to this task.

When entering or removing text, I find a 1-2 second delay before the state of "Upload to commons" is updated. This gives me a window in which I can upload a duplicate image, giving the same error as T216209#5107613.

This is unless I change focus, in which case the state us updated immediately.

MaxSem moved this task from In Development to Ready on the Community-Tech-Sprint board.
MaxSem added a subscriber: MaxSem.

It's getting too javascripty for me, would appreciate someone else looking at this.

A few more observations/potential bugs:

  1. Sometimes, if I have an unsaved translation, after logging in I cannot upload the translation to Commons (even after reloading the page or switching translation languages back and forth). I have seen this happen on FF60, FF66, Chromium 57.
  2. After successfully uploading a translation to Commons, I sometimes cannot upload a modified translation of the same language. I have seen this on FF60, FF66 and Chromium 57.

I have found can only get around the above two problems reliably by doing a hard refresh on the browser.

  1. If I switch to a translation which already exists in the SVG, without modifying it I can upload to Commons.

I will caveat the above by saying that the behaviour I am seeing does not always happen reliably. Sometimes, when I repeat the same action under the same conditions (as far as I can tell) I can get a different outcome. There may also be slight differences between browsers/browser versions.

Commits linked to this task have been released in svgtranslate 0.9.0.

@dom_walden Just making sure it's clear this is still in the QA column. No rush to get to it! I felt it was a semi-risky change, which is why I left it here. It looks like it's been deployed already and we haven't received any complaints, so maybe I didn't break anything :)

As for T216209#5140591, if those are still happening, I think they might be unrelated and deserving of separate tickets.

As for T216209#5140591, if those are still happening, I think they might be unrelated and deserving of separate tickets.

OK, I'll raise them separately. Otherwise, I am done.

Niharika moved this task from Product sign-off to Done on the Community-Tech-Sprint board.