Skip to content

Commit dc3023d

Browse files
PreshyCopilot
andauthored
fix: prevent deleted toolbar bookmarks from being reverted by auto-sync (#6)
* fix: prevent deleted toolbar bookmarks from being reverted by auto-sync Race condition: when a user deletes a bookmark while a sync is running, performSync's storeTombstones() overwrites the tombstone created by the onRemoved listener, causing the follow-up sync to re-add the bookmark from cloud. Fix: re-read current tombstones from storage before writing to preserve any tombstones added concurrently during the sync. * test: add integration test calling real performSync with mocked browser APIs Add __test__ exports (VITEST-only, tree-shaken in production) to background/index.js so integration tests can import and call the real performSync, addTombstone, categorizeCloudBookmarks, etc. New test file: toolbar-delete-race-integration.test.js (10 tests) - Calls the REAL performSync with fully mocked browser.* and fetch APIs - Simulates the tombstone race condition: delays cloud GET, fires onRemoved mid-sync, verifies tombstone is preserved after sync - Verifies deleted bookmark is NOT re-added from cloud - Tests tombstone merge, categorization filtering, concurrent sync guard, and state management - All 10 tests pass; 527 total passing (was 517) * Update apps/extension/__tests__/toolbar-delete-revert.test.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * chore: add screenshots/ to .gitignore * chore(release): v0.8.27 --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 574701a commit dc3023d

13 files changed

Lines changed: 2045 additions & 15 deletions

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ coverage/
4646
supabase/.branches/
4747
supabase/.temp/
4848

49+
# Screenshots
50+
screenshots/
51+
4952
# Misc
5053
*.local
5154
.cache/

0 commit comments

Comments
 (0)