notes icon indicating copy to clipboard operation
notes copied to clipboard

Multiple-instance support: open multiple instance, one instance update can directly reflect on another instance

Open evan0greenup opened this issue 6 months ago • 4 comments

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:

  • 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.

evan0greenup avatar Aug 05 '24 02:08 evan0greenup