Page MenuHomePhabricator

Page links are getting added as plain text in NWE when the editor is open for a long time(?)
Closed, ResolvedPublic1 Story Points

Description

Try to search for some pages using link inspector in NWE and add them.
Links to those pages are getting added as plain text .

Details

Related Gerrit Patches:

Event Timeline

Ryasmeen created this task.Feb 2 2017, 3:50 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 2 2017, 3:50 AM

Where is this happening? wfm.

DLynch added a subscriber: DLynch.Feb 2 2017, 5:50 PM

I reproduced it, but it went away after I did a pull and reloaded the editor. So... either weird and situational, or fixed by something subtle in the last day-ish. (Nothing in that timeframe looks relevant, though.)

I was getting it on Beta cluster and just found it happening on test2 too. This time I had the editor open for a while before adding any link.
But yes, it didnt happen anymore after I saved the edit and reloaded the editor.

Ryasmeen renamed this task from [Regression pre wmf.11] Page links are getting added as plain text in NWE to [Regression] Page links are getting added as plain text in NWE.Feb 2 2017, 8:16 PM
Jdforrester-WMF renamed this task from [Regression] Page links are getting added as plain text in NWE to [Regression] Page links are getting added as plain text in NWE when the editor is open for a long time(?).Feb 6 2017, 7:09 PM
Jdforrester-WMF triaged this task as High priority.
Jdforrester-WMF set the point value for this task to 1.
Jdforrester-WMF moved this task from To Triage to TR1: Releases on the VisualEditor board.
DLynch added a comment.Feb 7 2017, 3:43 PM

Problem here is that the CSRF token the editor's using for API calls times out, and it doesn't handle this gracefully. Or... it handles it sort of gracefully, in that it doesn't die outright.

{"error":{"code":"badtoken","info":"Invalid CSRF token.","*":"See http://dev.wiki.local.wmftest.net:8080/w/api.php for API usage."}}

It's also not just adding a link -- it's anything which the editor needs to make a visualeditoredit/serialize call for (i.e. anything which makes it pop up that momentary progress dialog).

Can we make visualeditoredit/serialize not require a token? API docs say it's just for data-modifying calls.

Change 336439 had a related patch set uploaded (by DLynch):
ArticleTarget: try to refresh editToken if getWikitextFragment fails

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

DLynch added a comment.Feb 7 2017, 5:37 PM

I did take a look at whether it'd be easy to have just serialize not require a token in ApiVisualEditorEdit.php. It wouldn't. Could make a new serialize method in ApiVisualEditor.php and migrate usage to that, of course, if it really doesn't require any data-saving.

In the meantime, the provided patch does some refactoring in ArticleTarget, so that the existing token refresh done when a save attempt fails with badtoken can be reused here, without any API changes needed.

Jdforrester-WMF renamed this task from [Regression] Page links are getting added as plain text in NWE when the editor is open for a long time(?) to Page links are getting added as plain text in NWE when the editor is open for a long time(?).Feb 7 2017, 7:22 PM
Jdforrester-WMF closed this task as Resolved.
Jdforrester-WMF assigned this task to DLynch.
Jdforrester-WMF removed a project: Patch-For-Review.
Restricted Application added a project: User-Ryasmeen. · View Herald TranscriptFeb 7 2017, 7:22 PM

Change 336439 merged by jenkins-bot:
ArticleTarget: try to refresh editToken if getWikitextFragment fails

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