From 2cbc9e5b136216061b2bcf5d62a88ed5ed0b0491 Mon Sep 17 00:00:00 2001 From: Suriya Date: Tue, 11 Aug 2026 10:48:53 +0530 Subject: [PATCH] docs: record that the external stream setup script is now read-only Birock/doormile-bookings/setup_jetstream.py called update_stream with the subject list replaced wholesale, from a hardcoded list that had drifted behind this repo. Re-running it would have stripped booking.cancelled, booking.outcome, booking.assignment_failed, chat.room.closed.* and -- worst -- booking.assignment_requested, which carries the assignment retry loop rather than merely reporting on it. Bookings would have stopped reaching riders with nothing logged, until a restart repaired the stream via EnsureStreams. A "setup" script that causes an outage when run is a bad thing to leave lying around. It is now an inspector: it reports streams, subjects and consumer state and has no add/update/delete calls at all. Verified it is the only script anywhere that pointed at doormile-nats (66.116.226.161:4223) -- every other stream-mutating script targets jupiter's NATS. Co-Authored-By: Claude Opus 5 (1M context) --- db/streams.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/db/streams.go b/db/streams.go index 5b689f9..44dfea7 100644 --- a/db/streams.go +++ b/db/streams.go @@ -12,7 +12,15 @@ import ( // JetStream server. It lives here, next to the code that publishes, on purpose: // the streams used to be created only by an external Python script // (Birock/doormile-bookings/setup_jetstream.py) on another machine, and the two -// drifted. Four of the eight subjects this app published were bound to no stream +// drifted. +// +// That script has since been reduced to a read-only inspector, because it +// updated streams with the subject list replaced wholesale. Re-running it would +// have stripped every subject added here — including booking.assignment_requested, +// which carries the assignment retry loop itself, so bookings would have stopped +// reaching riders entirely with nothing logged anywhere. This map is now the only +// place streams are defined; adding a js.Publish without adding its subject here +// means the event goes nowhere. Four of the eight subjects this app published were bound to no stream // at all — booking.cancelled, booking.outcome, booking.assignment_failed, and // chat.room.closed. (CHAT declared the literal "chat.room.closed", which does // not match a subject with an extra token). Every publish site is best-effort