Page MenuHomePhabricator

[Bug/Regression] New talk topic edits are lost when I click browser back button
Closed, ResolvedPublicBug

Description

tldr: onBeforeExit doesn't run when clicking back button meaning edits can be lost. This relates to the changes in T217102.

Expected: I do not leave the overlay and keep my edits
Actual: I leave the overlay and lose my edits

A similar but less severe problem exists in the editor. When opening the editor, entering text and clicking browser back the URL is lost. Clicking back and leave can take them out the site.

QA steps (passed)

Test on Visit https://en.m.wikipedia.beta.wmflabs.org/wiki/Spain

Talk

  • Visit a page and click talk button
  • Click add discussion
  • Type some text in the textarea
  • Click the close icon in the top left corner
  • Confirmation message appears. Click continue editing
  • Confirm you stay in the overlay, the URL remains #/talk/new
  • Type text in textarea
  • Press browser back button
  • Confirm you stay in the overlay, the URL remains #/talk/new

QA (failed)

The following QA step failed and has been pulled into its own bug : T218809

Editor

  • Visit a page and click edit
  • Type some text in the textarea
  • Click the close icon in the top left corner
  • Confirmation message appears. Click continue editing
  • Confirm you stay in the overlay, the URL remains #/editor/0
  • Type text in textarea
  • Press browser back button
  • Confirm you stay in the overlay, the URL remains #/editor/0

Event Timeline

Jdlrobson renamed this task from [Bug/Regression] TalkOverlay edits are lost when I click browser back button to [Bug/Regression] New talk topic edits are lost when I click browser back button.Mar 13 2019, 12:27 AM
Jdlrobson updated the task description. (Show Details)

Change 496081 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/MobileFrontend@master] onBeforeExit is also run on browser back/forward buttons

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

Jdlrobson triaged this task as High priority.Mar 13 2019, 12:32 AM

Note https://gerrit.wikimedia.org/r/496081 doesn't fix the problem, but blocks me making the fix!

Change 496354 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/MobileFrontend@master] Overlays are rendered inside a container

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

Change 496354 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Overlays are rendered inside a container

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

Jdlrobson updated the task description. (Show Details)Mar 19 2019, 1:22 AM

Change 496081 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] onBeforeExit is also run on browser back/forward buttons

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

Edtadros reassigned this task from Edtadros to Jdlrobson.Mar 20 2019, 5:40 AM

Test Result

Status: ❌ Fail
OS: macOS Mojave
Browser: Chrome DevTools Device Emulator (iPhone X)

Test Artifact(s):

Editor: ❌ FAIL

Visit a page and click edit
Type some text in the textarea
Click the close icon in the top left corner
Confirmation message appears. ✅
Click continue editing
Confirm you stay in the overlay, the URL remains #/editor/0 ✅
Type text in textarea
Press browser back button
Confirm you stay in the overlay, the URL remains #/editor/0 ❌


The url changes to: https://en.m.wikipedia.beta.wmflabs.org/wiki/Spain

Talk : ✅ PASS

Visit a page and click talk button
Click add discussion
Type some text in the textarea
Click the close icon in the top left corner
Confirmation message appears. Click continue editing ✅

Confirm you stay in the overlay, the URL remains #/talk/new ✅

Type text in textarea
Press browser back button
Confirm you stay in the overlay, the URL remains #/talk/new ✅

Jdlrobson updated the task description. (Show Details)

Confirm you stay in the overlay, the URL remains #/editor/0 ❌

Moved this out into T218809 since it requires significantly more work to fix. This task is ready for sign off now.

ovasileva closed this task as Resolved.Mar 21 2019, 9:44 AM
ovasileva updated the task description. (Show Details)
ovasileva added a subscriber: ovasileva.

resolving