Delayed write to file causes merge conflicts
Completed- Version 1.0.0 (2022.05.13.15.34) (up to date as of this writing)
- macOS 12.4 (21F79)
- M1 Pro MacBook Pro (14-inch, 2021)
- Files synced using Dropbox

I typed the word "frame" roughly 24 hours before this screenshot was taken. While nvUltra displayed the word, it was not written to the file.
I am able to reproduce similar* behavior in real-time by watching VS Code as I type in nvUltra. It seems only non-word characters trigger a save event -- I assume this is for performance reasons. After typing a word, I can wait multiple minutes and not see an update to the file. Any non-word character triggers an update immediately (confirmed with `tail -F`).
Is it feasible to implement a time-based write trigger for eventual consistency? This could fail if the machine is put to sleep immediately after an update, but would solve most cases. Any other ideas?
*In this case "/" should have been the trigger, so for the life of me I can't figure out how that "f" squeaked by. Is my whole theory way off?
Thanks for keeping the dream alive!
- Vito
-
The save to disk frequency matches the undo coalescing frequency in the Advanced preferences, for performance reasons as you suggest.
Additionally this happens when you shift focus to the search bar or notes table ("leaving" the file, as it were).
I will look at adding another trigger for this (e.g. a timer, or when the app loses focus).
Thanks!
0 -
That makes sense!
Thank you for the explanation, it will be nice to know how to avoid the merge conflict issue until/unless a new trigger is (potentially) added.
0 -
The next release will have nvUltra also save the file whenever the editor window loses key window status (you switch to another window, switch to another app, etc.)
0 -
Awesome, thanks again!
0
Please sign in to leave a comment.
Comments
4 comments