-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Prevent autoSave fns from calling commitChanges. (#102)
This risks dropping WIP changes, if the user makes a second WIP change while a first change has its request in-flight (triggered by the autoSave fn), after the in-flight promise resolves, if the autoSave function then does a "helpful" commitChanges: autoSave(form) { await saveMutation(form.changedValue); form.commitChanges(); } We'll immediately treat all WIP changes as 'accepted', and the 2nd autoSave, when it goes to run, will see the form as clean/nothing changed. Usually this is done on forms that are using `init` instead of the `init.map/input` pair to get the latest server-side data into the cache (which is the safer way of "un-dirty-ing" the fields from the first auto save request.)
- Loading branch information
Showing
3 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters