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:

Ciencia_Al_Poder updated the task description. (Show Details)
Ciencia_Al_Poder raised the priority of this task from to Needs Triage.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 20 2015, 5:58 PM
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 :)

Anomie moved this task from Unsorted to Non-Code on the MediaWiki-API board.Sep 21 2015, 12:53 PM
Anomie added a subscriber: Anomie.EditedSep 21 2015, 2:09 PM

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

Anomie set Security to None.
demon moved this task from Backlog to To be fixed on the MW-1.26-release board.Nov 2 2015, 7:17 PM
demon triaged this task as Low priority.
demon added a subscriber: demon.

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?

Tgr added a comment.Dec 11 2015, 10:20 PM

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.

demon removed a subscriber: demon.Mar 9 2017, 9:38 PM
Krinkle moved this task from Backlog to API on the MediaWiki-Page-editing board.Apr 12 2018, 4:11 PM
Krinkle moved this task from API to Stash on the MediaWiki-Page-editing board.Apr 12 2018, 4:17 PM