Page MenuHomePhabricator

"Invalid response from server" when switching to VE source mode
Closed, ResolvedPublicBUG REPORT

Description

This might be a train blocker for T392177: 1.45.0-wmf.7 deployment blockers because I can reproduce the following issue on 1.45.0-wmf.7 (e.g. mediawiki.org) but not on 1.45.0-wmf.6 (e.g. dewiki).

Steps to reproduce:

  • Make sure you have the preference enabled to "use the wikitext mode inside the visual editor".
  • Start editing any article in VisualEditor.
  • Make at least one change, e.g. add a character.
  • Switch to source editing with one of the two methods available in the toolbar(s) at the top.
  • A popup appears: "Invalid response from server."
  • When I click "Try again" the code apparently does not try to do the same again but does a different API request in the background. As a result the edit I just did gets lost.

We have also seen the wikitext disappear completely when switching to the classic wikitext editor instead.

Event Timeline

thiemowmde renamed this task from Unrecognized parameter: editingStatsId in visualeditoredit API to "Invalid response from server" when switching to VE source mode.Jun 25 2025, 9:21 AM

The use of editingStatsId emitting a warning can't be related, it has been that way for many years (I know, I know…).

I saw a lot of refactoring happening in mediawiki/extensions/VisualEditor to use newer JS features, maybe one of those changes broke something.

We have also seen the wikitext disappear completely but are not able to reproduce it.

I can reproduce this when switching to non-VE source mode with changes in the editor. This is definitely a deployment blocker.

Reverting 1141439 Fix no-jquery/no-done-fail warnings fixes this for me, so that would be an option to unblock the train. It's a large change and I haven't tried to find where exactly the mistake is.

Change #1163765 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/VisualEditor@master] [POC] Fix .then() in ArticleTarget dropping the return value

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

@matmarex Yea, I can confirm this. I made a patch to illustrate what I found, see https://gerrit.wikimedia.org/r/1163765. Personally I think it's better to revert the entire patch. It seems this is still possible with no conflict.

thiemowmde triaged this task as Unbreak Now! priority.Jun 25 2025, 1:00 PM
thiemowmde updated the task description. (Show Details)

Change #1163767 had a related patch set uploaded (by Esanders; author: Esanders):

[mediawiki/extensions/VisualEditor@master] ArticleTarget: Avoid using chained promises with different return values

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

This was identified in my code review of the original patch but somehow I missed it when reviewing the second time. My patch above fixes by just removing the chaining.

Change #1163768 had a related patch set uploaded (by Esanders; author: Esanders):

[mediawiki/extensions/VisualEditor@wmf/1.45.0-wmf.7] ArticleTarget: Avoid using chained promises with different return values

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

Change #1163765 abandoned by Thiemo Kreuz (WMDE):

[mediawiki/extensions/VisualEditor@master] [POC] Fix .then() in ArticleTarget dropping the return value

Reason:

See I842483c.

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

Change #1163768 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@wmf/1.45.0-wmf.7] ArticleTarget: Avoid using chained promises with different return values

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

Mentioned in SAL (#wikimedia-operations) [2025-06-25T13:59:31Z] <esanders@deploy1003> Started scap sync-world: Backport for [[gerrit:1163768|ArticleTarget: Avoid using chained promises with different return values (T397818)]]

Mentioned in SAL (#wikimedia-operations) [2025-06-25T14:01:57Z] <esanders@deploy1003> esanders: Backport for [[gerrit:1163768|ArticleTarget: Avoid using chained promises with different return values (T397818)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2025-06-25T14:11:11Z] <esanders@deploy1003> Finished scap sync-world: Backport for [[gerrit:1163768|ArticleTarget: Avoid using chained promises with different return values (T397818)]] (duration: 11m 40s)

Change #1163767 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] ArticleTarget: Avoid using chained promises with different return values

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

matmarex assigned this task to Esanders.