Further conversation revealed that this was an outdated parsoid version, causing all parsefragment calls to fail. This is unusually bad -- normally this would only happen in situations where the network connection was getting dropped, where the user might at least be less surprised that things started going wrong.
The more common bad case is probably slow connections where things take a while to open in NWE for no obvious reason. There's a TODO: Show progress bar without breaking WindowAction which would expose that were it ever implemented.
Technically, ve.ui.MWMetaDialog.static.handlesSource = true would have solved this specific case. However, although we don't do this internally, codesearch suggests that there's other extensions out there that do (and probably in a buggy way; looks like the BlueSpice cluster would maybe cause some weird side-effects if someone with them installed used the options dialog while in source mode) that wouldn't respond well to that changing.
Since this failure is unrecoverable (the dialog claims to need the fragment, and it cannot be generated without that API call), the initial problem is that we give no feedback, and actively swallow the error.
We should make it so that a failed fragment conversion logs the that an error happened to the console instead of failing silently. It's non-obvious, but people can find it and report it rather than having literally no evidence of what happened.
(There's an additional side-effect that the conversion's position in the chain stalls the WindowAction#open promise... but nothing in this chain seems to actually be bothered by that. Probably still good to clean it up, though.)
Theoretically we could be more proactive about saying a request failed if we wanted, via mw.notify or similar, but it's also not a situation where we can really give someone actionable advice. "We know something went wrong, sorry" might be appreciated, I guess...
Derived Requirement
Ensure that when wikitext fragment conversion fails in source mode, the failure is logged to the browser console instead of failing silently. ([Phabricator][1])
Test Steps
Preconditions
- Open a page in the 2017 wikitext editor.
- Open the browser Developer Tools console.
- Create conditions that cause the action=visualeditor&paction=parsefragment request to fail.
Test Case 1: Ensure failed fragment conversion is logged to the console
- Select non-empty wikitext in the source editor.
- Trigger a dialog that requires conversion of the selected wikitext fragment.
- Cause the fragment conversion request to fail.
- Observe that the dialog does not open.
- Review the browser console.
- ✅❓❌⬜ AC1: A failed wikitext fragment conversion produces an error in the browser console instead of failing without any logged error.
QA Results - TestWiki
| AC | Status | Details |
|---|---|---|
| 1 | ✅ | T433560#12254544 |