Page MenuHomePhabricator

JS Error occurs when cancelling writing a comment on mobile structured talk pages
Closed, ResolvedPublicBUG REPORT

Description

Steps to Reproduce:

  1. Go here: https://cs.m.wikipedia.org/wiki/Česko#/talk/2
  2. Add comment.
  3. Click Back button (upper left).

Actual Results:
Sytem warns me, that my changes will be discard, but changes are published (and changes can't be discard).

Developer notes

When the textarea is focused on the reply form in https://en.m.wikipedia.beta.wmflabs.org/wiki/Kosovsk%C3%A1_republika#/talk/4 and you CLICK the back button - a js error appears in console:

VM69:110 Uncaught TypeError: e is not a function
    at v.onBeforeExit (<anonymous>:110:261)
    at v.onExitClick (load.php?lang=en&modules=jquery|mobile.startup|skins.minerva.mainMenu.styles|skins.minerva.options%2Cscripts%2Ctalk&skin=minerva&version=1tea4he:165)
    at HTMLDivElement.dispatch (load.php?lang=en&modules=jquery|mobile.startup|skins.minerva.mainMenu.styles|skins.minerva.options%2Cscripts%2Ctalk&skin=minerva&version=1tea4he:69)
    at HTMLDivElement.elemData.handle (load.php?lang=en&modules=jquery|mobile.startup|skins.minerva.mainMenu.styles|skins.minerva.options%2Cscripts%2Ctalk&skin=minerva&version=1tea4he:65)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 13 2019, 7:30 PM
Patriccck updated the task description. (Show Details)Aug 13 2019, 7:31 PM
Aklapper renamed this task from Mobile structured talk pages to Cancelling writing a comment on mobile structured talk pages publishes comment.Aug 15 2019, 11:31 AM
Aklapper added a project: MobileFrontend.

Add comment.

Do you only write a comment, or do you also publish it by clicking "Zveřejnit"?

I cannot even write any text in the field of that page. When I put the focus into that text field, I get in Chromium:

VM72:113 Uncaught TypeError: Cannot read property 'removeClass' of undefined
    at v.onFocusTextarea (<anonymous>:113:60)
    at HTMLDivElement.dispatch (load.php?lang=cs&modules=jquery&skin=minerva&version=0hmxo20:69)
    at HTMLDivElement.elemData.handle (load.php?lang=cs&modules=jquery&skin=minerva&version=0hmxo20:65)
    at Object.trigger (load.php?lang=cs&modules=jquery&skin=minerva&version=0hmxo20:113)
    at Object.simulate (load.php?lang=cs&modules=jquery&skin=minerva&version=0hmxo20:114)
    at HTMLDocument.handler (load.php?lang=cs&modules=jquery&skin=minerva&version=0hmxo20:114)
Jdlrobson renamed this task from Cancelling writing a comment on mobile structured talk pages publishes comment to JS Error occurs when cancelling writing a comment on mobile structured talk pages.Aug 15 2019, 7:02 PM
Jdlrobson updated the task description. (Show Details)
Jdlrobson added a subscriber: Jdlrobson.

I can replicate this on cs.wikipedia (although "but changes are published" doesn't seem to be happening for me).
Is this actually causing any problems other than not allowing you to escape the talk overlay? I can't see any evidence of incomplete replies being posted.

Change 530439 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/MobileFrontend@master] Always pass a cancel function to onBeforeExit

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

Jdlrobson triaged this task as Medium priority.
Jdlrobson added a project: good first task.
Jdlrobson moved this task from Incoming to Needs Prioritization on the Readers-Web-Backlog board.

JS errors add noise. Not sure how much of an error this one is but since we know it - let's get rid (plus solution is super easy).

Patriccck added a comment.EditedAug 17 2019, 11:54 AM

@Aklapper I clicked "Zveřejnit" button.

Change 530439 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Always pass a cancel function to onBeforeExit

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

Niedzielski reassigned this task from Edtadros to nray.Aug 21 2019, 5:10 PM
Niedzielski added a subscriber: Edtadros.

lgtm, error no longer appears in console

nray removed nray as the assignee of this task.Aug 22 2019, 10:22 PM
nray added a subscriber: nray.
Patriccck updated the task description. (Show Details)Aug 23 2019, 11:32 AM

I fixed link in task description.

ovasileva closed this task as Resolved.Aug 26 2019, 2:51 PM
ovasileva claimed this task.

looks good!