You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the status changes from auto-draft to draft by auto-save, an undo level is created. This seems unexpected as it is an automatic background change, and not something that is caused by a manual action and should be undoable.
Steps to Reproduce (for bugs)
Log undo state changes with the action.
Open the demo content and change some things. Wait for auto-save to trigger.
Observe:
{"type":"EDIT_POST","edits":{"status":"draft"}}
The text was updated successfully, but these errors were encountered:
This is challenging, because background changes should be expected, but this is in conflict with the approach to the undoable reducer where such changes would be captured as a distinct point in history which can be recovered.
Two options I could imagine are:
Actions can opt-out of being counted for undo history, so in the case of background changes such as this one, we can include additional metadata with the action to flag it as such
Actions must opt-in to being counted for undo history, so instead of undoable reducer reflecting any changes to state over time, it only reflects those changes which are flagged to be counted
To test this, I tried creating a new post and adding content then waiting for autosave and clicking the undo button. In my test, undo worked to remove the last text change. I suspect if this were still an issue that undo in this context would have to be clicked twice: once for the autosave undo and once for the prior text change. Does this make sense and do you agree this issue is resolved?
Issue Overview
When the status changes from
auto-draft
to draft by auto-save, an undo level is created. This seems unexpected as it is an automatic background change, and not something that is caused by a manual action and should be undoable.Steps to Reproduce (for bugs)
The text was updated successfully, but these errors were encountered: