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
It would be nice to make notes support multiple instance toward single database be opened simultaneously, because user may edit different pages within a single database.
And the content change in one instance can immediately take effect on another instance.
implementation
avoid data corruption:
Use transaction feature of underlying database (SQLite).
Use filelock (OS-level)
Aware the content update when other instance make change:
save the last update timestamp in a file. If the time is newer than the in-memory record, synchronize the content.
use file-watcher to keep track of file update.
The text was updated successfully, but these errors were encountered:
Instead of supporting multiple instances, I think it's better if we support one instance with multiple windows. It would accomplish what you propose without having to implement transactions/filelocks/synchronizations, as we would still handle the database through a single instance.
What are you trying to accomplish, @evan0greenup? Editing the same note from multiple windows? If so, how about a split screen feature? Or tabs? Both features I've had on my mind.
Previously, I make proposal on launch note with custom profile directory. #682. If launching the notes with different profile/database, It is supposed to run a different instance.
Comparison on two approach
The first one is what @nuttyartist and @zjeffer recommended. Attaching to existed instance with same profile/database. (This is also how firefox works). But it require programming with dbus, and the inter-process communication is quite complicated. At least, I have no clear idea on how to implement it. (May be because I am not experienced enough).
The second one is my proposal. Despite of whether there is existed instance running for given profile directory/database filename. Just to ensure in low level multiple instance toward single database will not cause corruption. This approach is straight-forward.
Cross-platform is a big factor for choosing one among these two approaches above.
The first one is what @nuttyartist and @zjeffer recommended. Attaching to existed instance with same profile/database. (This is also how firefox works). But it require programming with dbus, and the inter-process communication is quite complicated. At least, I have no clear idea on how to implement it. (May be because I am not experienced enough).
If you only need to accomplish editing multiple notes from the same database, you could add a way to open a note in a separate window (e.g. by double-clicking or with an option in the context menu), which would still be in the same process (so no IPC necessary).
Currently, only single instance can be opened.
It would be nice to make
notes
support multiple instance toward single database be opened simultaneously, because user may edit different pages within a single database.And the content change in one instance can immediately take effect on another instance.
implementation
avoid data corruption:
Aware the content update when other instance make change:
The text was updated successfully, but these errors were encountered: