Page MenuHomePhabricator

[BUG] Prevent preview errors when leaving page
Closed, ResolvedPublic3 Estimated Story PointsBUG REPORT

Description

What is the problem?

When the cursor is in one of the translation inputs and you click on something that navigates you away from the page (e.g. "Log in"), you see "An error occurred when fetching the preview...".

This seems to mainly affect Firefox.
These include:

  • "Log in"
  • "Log out"
  • "pick another file"
  • Some of the links in the footer
Steps to reproduce problem
  1. Go to any file in SVGTranslate (e.g. https://tools.wmflabs.org/svgtranslate-test/File:2002_AJ129-orbit_(multilingual).svg )
  2. Click in any of the translation inputs (select a translation language first if necessary)
  3. Click "pick another file"

Expected behavior: Go to the SVGTranslate front page
Observed behavior: See a popup error (briefly) before going to the SVGTranslate front page

Proposed solution

In T221783, we disabled the "Download" link while a preview was being fetched. We could do the same for other links on the page.

Environment

Operating system: Debian Stretch
Browser: Firefox 60

Event Timeline

Niharika updated the task description. (Show Details)
Niharika moved this task from New & TBD Tickets to Needs Discussion on the Community-Tech board.
Niharika subscribed.

This is a fairly straightforward issue that we should fix.

Niharika set the point value for this task to 3.Jun 11 2019, 11:59 PM
Niharika moved this task from Needs Discussion to Up Next on the Community-Tech board.

Two PRs, because i18n updates are not compiled to public/assets when they're merged:

  1. https://github.com/wikimedia/svgtranslate/pull/123 — i18n updates.
  2. https://github.com/wikimedia/svgtranslate/pull/122 — this is the one for this issue.

Cannot reproduce on Firefox, Chromium, IE11 or Safari.

For regression purposes, I simulated conditions under which the preview would fail to load and checked the "An error occurred when fetching the preview..." error did display.