Commit dc3023d
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
File tree
- apps
- extension
- __tests__
- src
- background
- web
- packages
- core
- sources
- types
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
49 | 52 | | |
50 | 53 | | |
51 | 54 | | |
0 commit comments