chrisputnam9 / quixer

Quixer - Quick Search - The hacker's bookmarks?
MIT License
0 stars 0 forks source link

Sync update check bug #108

Closed chrisputnam9 closed 1 year ago

chrisputnam9 commented 1 year ago

To replicate:

  1. Browser 1, remove item
  2. Browser 2, remove item
  3. Browser 1, sync
  4. Browser 2, sync
  5. Refresh browser 1 - missing changes but sync not recommended
chrisputnam9 commented 1 year ago

The issue is because we are checking remote update against local sync

Might be as simple as always comparing by sync time, eg:

chrisputnam9 commented 1 year ago

The problem is, this results in a sync cycle:

  1. Browser 1 now shows updates on refresh, so we sync
  2. But now, Browser 2 will show updates on refresh - because sync time has changed from step 1
  3. So, we sync Browser 2, but now Browser 1 shows updates, and so on.

Instead, maybe we can:

  1. Keep using updated_at
  2. When syncing, compare JSON strings to see if anything actually is changing
  3. If things are changing either in local or remote, then set updated_at to current time
  4. Otherwise, leave it as is
chrisputnam9 commented 1 year ago

Set up - need to test more

chrisputnam9 commented 1 year ago

Need to reduce API calls - shouldn't hit API every time a change is made in config...

chrisputnam9 commented 1 year ago

Looking good - a bit more testing then launch