Page MenuHomePhabricator

Wikitext editor error handling broken in read only mode
Closed, ResolvedPublic3 Story Points

Description

A wiki can be made readonly like so:

$wgReadOnly = true;

If the editor has been opened before read only mode has been invoked, and an edit is completed with the mobile source editor, when the save fails, a toast is presented with a generic error message, but the toast is not visible until you scroll down, and the toast appears "underneath" the article content. The error message should probably display the "apierror-readonly" message EditorOverlay.js#L285

Acceptance criteria

  • Make sure any error is displayed inside the editor itself, above the preview, using errorbox class (note other box styles may be inside mobile.special.styles.
  • Remove code relating to toast error handling.
  • Include and display the apierror-readonly error message when this error occurs

Mock:

Developer/designer notes

Code lives inside MobileFrontend.

QA steps

read only mobile

Open the mobile editor.
While open, ask a developer to enable

$wgReadOnly = 'This wiki is currently being upgraded to a newer software version.';
  • Does the read only message show inside the editor when you try to save your edit?

Event Timeline

Jdlrobson triaged this task as Normal priority.Jun 15 2018, 10:19 PM
Jdlrobson created this task.
Jdlrobson added a subscriber: alexhollender.

@alexhollender which of the solutions looks preferable to you?

@Jdlrobson the red error inside of the editing space looks good 👍

Jdlrobson removed Jdrewniak as the assignee of this task.Jun 18 2018, 3:55 PM
Jdlrobson updated the task description. (Show Details)
Jdlrobson moved this task from Incoming to Triaged but Future on the Readers-Web-Backlog board.
Vvjjkkii renamed this task from Wikitext editor error handling broken in read only mode to 8saaaaaaaa.Jul 1 2018, 1:03 AM
Vvjjkkii raised the priority of this task from Normal to High.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
CommunityTechBot renamed this task from 8saaaaaaaa to Wikitext editor error handling broken in read only mode.Jul 2 2018, 12:05 PM
CommunityTechBot lowered the priority of this task from High to Normal.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added a subscriber: Aklapper.

Looking like a 3. Confirmation to follow!

Jdlrobson set the point value for this task to 3.Jul 31 2018, 1:59 AM
Jdrewniak moved this task from To Do to Doing on the Readers-Web-Kanbanana-Board-Old board.

Change 453131 had a related patch set uploaded (by Jdlrobson; owner: Jdrewniak):
[mediawiki/extensions/MobileFrontend@master] Remove toast-style error messaging from source editor overlay

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

An update on the treatment.
Admins can supply either a message or a boolean when putting the wiki in readonly mode. I've incorporated this message into the treatment in case it exists.

Error logging?
I noticed in the code that edit errors appear to be logged to Schema:Edit. I'm assuming errors from readonly mode should also be logged? @Tbayer please confirm.
@Jdlrobson I don't know how mf.schemaEdit is loaded in mobileFrontend. Usual it's defined in extensions.json, but I don't see it there. (If I update the schema, I'll need to bump the version).
...5 minutes later, oh, looks like the schema is being created here with new mw.eventLog.Schema with a version of 1, is that valid?

CCing @Neil_P._Quinn_WMF who is more qualified to speak about the Edit schema.

This has been enabled on staging.
A visit to http://reading-web-staging.wmflabs.org/wiki/Main_Page#/editor/0 will open the editor interface. Try to make a save and you will see the error.

The message is rendering correctly. Where does the copy come from? I'm wondering if we can add something to the end like Please check back in a few hours (or whatever time frame would be appropriate) @Jdlrobson @ovasileva

The error message copy is set by the user turning on read only mode i.e. me in this case so yes please check back etc can be added. https://m.mediawiki.org/wiki/Manual:$wgReadOnly#Details

Tested on Mac desktop, iOS, and Android. Looks good all around. Moving to signoff.

iOSandroid
ovasileva reassigned this task from ovasileva to Jdlrobson.Aug 27 2018, 12:27 PM

Passing to @Jdlrobson for the technical portions of signoff

ovasileva updated the task description. (Show Details)Aug 27 2018, 12:28 PM
Jdlrobson closed this task as Resolved.Aug 27 2018, 9:50 PM
Jdlrobson updated the task description. (Show Details)