bookmark-notes icon indicating copy to clipboard operation
bookmark-notes copied to clipboard

Improve sync logic

Open wincohi opened this issue 6 years ago • 0 comments

Currently, notes are kept in storage.sync only, which is overwritten each time Firefox Sync does its thing. This can potentially result in partial data loss if, for instance, a note is added before Firefox syncs the latest data.

To solve this, my plan is as follows:

  • Convert notes into objects with the following properties:
    • content: The content of the note
    • modified: A timestamp of the last time the note was changed
  • Save notes to and read from storage.local
  • Copy from local -> sync
  • Whenever storage.sync changes, compare timestamps of each note, create a new object with the most recent notes, then update both local and sync

Since this will require migrating note objects to a new format that will break backward compatibility, it's better suited for a larger release, and most certainly after #26 has been resolved.

wincohi avatar Oct 15 '18 13:10 wincohi