Skip to content

fix(sync): cascade series exceptions on provider delete#2398

Merged
tyler-dane merged 2 commits into
mainfrom
cursor/fix-provider-series-delete-cascade
Jul 25, 2026
Merged

fix(sync): cascade series exceptions on provider delete#2398
tyler-dane merged 2 commits into
mainfrom
cursor/fix-provider-series-delete-cascade

Conversation

@tyler-dane

Copy link
Copy Markdown
Contributor

Summary

  • After Google confirms a provider series delete (scope=all), Sync now cascades findSeriesExceptions: clear occurrence rows, delete exception events, then delete the master (same order as cloud series delete).
  • Already-gone replay path also clears leftover exceptions so older staging orphans and crash mid-cascade residue heal on retry.
  • DB coverage: series master + exception → both gone; orphan exception with missing master → cleared on replay.

Why

Staging cutover found Google instance overrides left active after Compass deleted the series. Pull cannot heal once the master is gone. Browser DELETE 503 with backend 204 remains reporting noise; this is the real blocking Sync gap.

Test plan

  • bun test:sync -- packages/sync/src/domain/provider-command.service.db.test.ts
  • bun test:sync (full suite)
  • Staging re-gate after deploy: create weekly → Google edit one instance → delete scope=all → range has neither master nor exception; orphan scan clean; CRUD smoke

Made with Cursor

tyler-dane and others added 2 commits July 25, 2026 13:46
Provider scope=all deletes removed the master after Google confirmed but
left local exception rows (Google instance overrides) active, so range
reads kept showing orphans. Mirror the cloud delete cascade.

Co-authored-by: Cursor <cursoragent@cursor.com>
@tyler-dane
tyler-dane merged commit 2de9970 into main Jul 25, 2026
19 checks passed
@tyler-dane
tyler-dane deleted the cursor/fix-provider-series-delete-cascade branch July 25, 2026 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant