Open donnapep opened 11 months ago
In a quick test, I tried to add many lessons to a course, and it didn't increase the number of savings.
IIRC, it should save 2 times only:
hasUnsavedServerUpdates
would be true
) to save the new attributes.So I'm not sure why we have 3 saves. The reference where it's probably happening is here: assets/shared/structure/structure-store.js
.
If it's helpful, at some point I wrote assets/shared/helpers/editor-lifecycle.js
, which could be useful in a refactor to simplify the subscribeToPostSave
.
Steps to Reproduce
What I Expected
The editor to save once.
What Happened Instead
The editor appears to be saving multiple times, probably once per lesson.
Screenshot / Video
https://github.com/Automattic/sensei/assets/1190420/25834d0d-9d7d-4f33-a4f0-ced58d872443