Steps to reproduce
- Edit a page using DiscussionTools while logged out and temp accounts are enabled.
- For example, https://patchdemo.wmflabs.org/wikis/a61a6b72be/w/index.php?title=Talk:Main_Page&action=edit§ion=new.
- You get an error: "You are no longer logged out, so the action could not be completed."
The patches in T359405: Create temporary account early in edit cycle for all edit attempts mean that MediaWiki will create a temporary account on edit attempts. This means that a failed edit attempt will result in the user being logged-in to a temporary account.
This causes problems for API editing via Discussion Tools (see T367843: Can't save changes in DiscussionTools when temp accounts are enabled: "You are no longer logged out, so the action could not be completed."), because after the initial failed edit attempt, the user is logged-in, but Discussion Tools still assume the user is not logged-in. In VisualEditor, this is less of an issue because it can use the ve.init.mw.Target.prototype.refreshUser mechanism to update the user account.
We need some special handling in the error response in DiscussionTools to check if the user is now logged-in as a temp account.
As a bonus, it would be nice to also then load the temp account banner, but that probably should be split out into its own task.
Acceptance criteria:
- Anonymous editor who fails an edit because of triggering a CAPTCHA and is then logged-in as a temp account should be able to save the edit after filling the CAPTCHA
Timing
Per discussion with @kostajh offline, the Editing Team is committed to resolving this issue before August 2024 is over.