Page MenuHomePhabricator

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

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

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

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

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 ❌

Screen Shot 2019-03-19 at 10.20.29 PM.png (1×946 px, 295 KB)

The url changes to: https://en.m.wikipedia.beta.wmflabs.org/wiki/Spain
Screen Shot 2019-03-19 at 10.39.19 PM.png (2×1 px, 862 KB)

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 ✅

Screen Shot 2019-03-19 at 10.30.36 PM.png (2×1 px, 653 KB)

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

Screen Shot 2019-03-19 at 10.32.01 PM.png (2×1 px, 650 KB)

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

Screen Shot 2019-03-19 at 10.31.51 PM.png (2×1 px, 651 KB)

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 updated the task description. (Show Details)
ovasileva subscribed.

resolving