Page MenuHomePhabricator

Disable editing on pages that experience mediawiki API failures while generating HTML
Closed, DeclinedPublic

Description

See https://phabricator.wikimedia.org/T97204#1249194 for more context

Independent of retries and how that retry policy will evolve, we definitely need a mechanism to disable editing for pages that experienced MW API failures while generating HTML. Over time, this blanket disabling policy can be refined, if found necessary.

Event Timeline

ssastry raised the priority of this task from to Medium.
ssastry updated the task description. (Show Details)
ssastry added projects: Parsoid, VisualEditor.
ssastry added subscribers: ssastry, tstarling, GWicke.

From Parsoid's perspective, the failed template encapsulation can be treated as the output of the template (with special markup on it), and as long as the source offsets from the transclusion are preserved (which we can), selser should still serialize the page properly in the face of edits.

However, the DOM structure can very well be quite different from the success scenario (because of unbalanced templates that might generate open/close tags) which means the edit experience will degrade and WYSIWYG will be broken for those edits. Optionally, you can enable editing knowing that on some sections, edit experience might be broken. Parsoid, on its end, can add additional smarts to narrow the DOM structure that might be affected by this, but I am not convinced the additional complexity is worth it. So, disabling editing on those pages seems like a reasonable thing to do given that these kind of failures are expected to be rare and an exceptional condition anyway.

From ext.core.TemplateHandler.js:

// We have a choice between aborting or keeping going and reporting the
// error inline.
// TODO: report as special error token and format / remove that just
// before the serializer. (something like <mw:error ../> as source)
if ( err ) {
    src = '';
    //  this.manager.env.errCB(err);
}

So, we need to update that portion of the code, and if we decide to disable editing, we need to mark that on the <body> tag.

Image info timeouts are handled differently since their impact is restricted to the image itself. They are represented in the DOM (see https://www.mediawiki.org/wiki/Parsoid/MediaWiki_DOM_spec#Error_handling ) and can potentially help editors fix the errors in some cases. In other scenarios, it doesn't adversely impact editing.

No longer relevant in the Parsoid/PHP world