refactor(server): collapse duplicated sync stream handlers

The sync service hand-rolled the same delete/upsert/backfill/create stream
loops across ~27 per-entity handlers. Extract four typed helpers on
SyncService — streamDeletes, streamUpserts (overloaded, optional map),
streamBackfill, and streamCreates — and rewrite each handler to call them.

Behavior is unchanged: the per-parent backfill bookkeeping
(isEntityBackfillComplete / getStartId / completion acks / checkpoint
seeding) and the create-stream's one-time ack are preserved exactly, and
the OCR delete keeps its whole-row payload. Verified by the sync medium
test suite (26 files, 145 tests) plus tsc and eslint.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Claude (thor) 2026-08-10 18:31:09 -04:00
parent 0ff47f4178
commit bd967ce5e4

File diff suppressed because it is too large Load diff