Page MenuHomePhabricator

Document ApiStashEdit
Open, LowPublic

Description

Since MediaWiki 1.25 I see that during editing a page with the normal wiki editor, it makes a POST request to api.php, passing a action=stashedit

Since it's a POST request, it's somewhat difficult to see what's the specific api action it triggers. Also, looking at the RELEASE NOTES for 1.25 I don't see anything obvious about it, except this:

  • Edits are now prepared via AJAX as users type edit summaries. This behavior can be disabled via $wgAjaxEditStash.

Well, that's not even accurate, since the POST request is made when focusing the textarea, not the edit summary. What does "Edits are now prepared" actually mean? If I focus the text area, what's the purpose of sending the textarea contents if I haven't even started to modify it? What's the benefit of "preparing an edit" that outcomes the additional server load?

Manual:$wgAjaxEditStash is more of the same, it doesn't explain anything useful, apart that saying you can disable it. No documentation about benefits, what won't work if you disable this feature, etc

See also:

Event Timeline

Ciencia_Al_Poder raised the priority of this task from to Needs Triage.
Ciencia_Al_Poder updated the task description. (Show Details)
matmarex added subscribers: ori, matmarex.

This was primarily @ori's work.

What does "Edits are now prepared" actually mean? If I focus the text area, what's the purpose of sending the textarea contents if I haven't even started to modify it? What's the benefit of "preparing an edit" that outcomes the additional server load?

It means that the wikitext is being parsed before you save the edit (ideally, while you're typing in the summary, which is where the release note likely comes from). The benefit is that saving large page that take a long time to parse is much more responsive to the user (ideally, near instantaneous).

Looking at the code, it appears that it stashes the wikitext when the user has stopped typing for three seconds. This might be a little excessive, especially for small installations – hopefully Ori will explain why that behavior was chosen :)

This was primarily @ori's work.

I thought it was @aaron. At least the API module was, anyway.

Change 239843 had a related patch set uploaded (by Anomie):
Add i18n messages for ApiStashEdit

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

Change 239843 merged by jenkins-bot:
Add i18n messages for ApiStashEdit

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

demon moved this task from Backlog to To be fixed on the MW-1.26-release board.
demon subscribed.

Removed 1.26 release. This went out in 1.25 and that was the time to have better release notes. The API messages will be in 1.26 already. The remainder of this bug is about on-wiki docs.

@Tgr has created the Optimistic save page, this may effectively make this bug as resolved (although there are no release notes).

Still, the documentation doesn't reflect the actual behavior described in T113189#1657082. Should a bug be opened for this bad behavior, or is the documentation wrong?

Still, the documentation doesn't reflect the actual behavior described in T113189#1657082. Should a bug be opened for this bad behavior, or is the documentation wrong?

Probably the latter, I am not particularly familiar with the feature and was just working from the release notes and random scraps of information I could find.