Skip to content

Going-forward trouble-ticket poller + repoint /trouble-tickets to events - #298

Merged
JamesMoulang merged 3 commits into
mainfrom
feature/tt-poller
Sep 21, 2026
Merged

JamesMoulang merged 3 commits into
mainfrom
feature/tt-poller

Conversation

@JamesMoulang

Copy link
Copy Markdown
Collaborator

Stacked on #297. Mirror of the quiz migration's #285 + #287, in one small PR.

  • Poller: runTroubleTicketIngest wired into the sync worker's existing 20-minute trouble-ticket beat, right after the sheet pull — new tickets become TroubleTicketCreated events within one cycle. Dedup by rowHash makes every re-run free.
  • Repoint: /trouble-tickets now reads sharedReadModel.troubleTickets instead of the sheet cache (same super-user gate, same 6-month window), and renders the parsed answers as labelled lines — fixing the old double-JSON.stringify blob. The sheet cache stays; it's still the ingestion source.

⚠️ Merge gate

Draft until the one-time backfill (#297) has run and been verified on prod. The append path claims each row's hash at recordedAt = now; deploying this first would permanently prevent historical tickets from being woven in at their true submission times. Same ordering the quiz migration enforced (#285 merged only after the #276 backfill ran). The SAFETY comment in src/sync-worker/index.ts records this.

🤖 Generated with Claude Code

JamesMoulang and others added 2 commits September 21, 2026 08:55
Wires runTroubleTicketIngest into the sync worker's existing 20-minute
trouble-ticket beat, guarded by the SAFETY comment: this must not deploy
until the one-time timeline backfill has run and been verified on prod,
because the append path claims each row's hash at recordedAt = now.

Repoints the /trouble-tickets POC page from the sheet cache to the
troubleTickets read model (still super-user only, still windowed to 6
months), rendering the parsed answers as labelled lines instead of the
double-stringified JSON blob. The sheet cache stays: it remains the
ingestion source.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The /trouble-tickets repoint left deps.getTroubleTicketData unread by any
production code; drop the field and its wiring (the underlying function
stays - the sync worker path and tests use it directly). Also reword the
ingest driver's comment, which still claimed it wasn't wired into the
sync worker.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@JamesMoulang
JamesMoulang changed the base branch from feature/tt-backfill to main September 21, 2026 07:57
An old sync bug left rows with every column NULL; the sheet_id-scoped
cache replacement can never delete them (NULL never matches =), so prod
carried 542 of them forever and the ingest would warn about them every
cycle. Sweep them in the same atomic batch as the cache update.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@JamesMoulang
JamesMoulang marked this pull request as ready for review September 21, 2026 08:24
@JamesMoulang
JamesMoulang merged commit 19ce70e into main Sep 21, 2026
11 of 12 checks passed
@github-project-automation github-project-automation Bot moved this from Options to Done in Makespace Members App Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant