mirror of
https://github.com/moodle/moodle.git
synced 2025-04-01 06:22:35 +02:00
The autosave is reset on form submission, but if that form submission happens at the same time as a page reload, the connection and/or server is slow, then the connection may be aborted before the session is removed. This commit changes the autosave reset to use the fetch() API with a keepalive flag. Unfortunately we do not have a formal endpoint for this in Moodle JS so this is a hackier approach than I would like. MDL-76463 has been opened to investigate this. This commit also fixes a situation where the autosave content is re-sent when the user has typed in the editor and their next action is to click on the submit button. This is now blocked for that editor instance.