keeptrack.space icon indicating copy to clipboard operation
keeptrack.space copied to clipboard

refactor: rewrite PersistenceManager with centralized data management

Open thkruz opened this issue 1 month ago • 2 comments

  • Add new EventBusEvent types: buildDataUpdate, buildPreferencesUpdate, debouncedSync
  • Implement centralized preferences and userData objects
  • Add EventBus listeners for automatic data/preferences updates
  • Implement debounced sync with 3-second delay
  • Add isUseLocalStorage and isUseRemoteStorage flags
  • Sync loop runs when either storage flag is enabled
  • Save to localStorage only when isUseLocalStorage is true
  • Emit debouncedSync event for external sync (e.g., Supabase)
  • All data is properly serialized to JSON
  • Load from localStorage on initialization

Breaking Changes:

  • Removed old getItem(), saveItem(), checkIfEnabled() methods
  • Code using old API will need to be updated to use new preferences/userData objects

thkruz avatar Nov 17 '25 10:11 thkruz

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Nov 17 '25 10:11 CLAassistant