Documentation
¶
Overview ¶
Command sqfix is the send-queue browser spec's fixture (e2e/tests/send-queue.spec.ts): the two states of a queued message the spec cannot reach through a real route in a few seconds — a message queued days ago, and a message whose sender stopped mid-send.
DATABASE_URL=…_e2e go run ./e2e/sqfix age <host> <body> <seconds>
DATABASE_URL=…_e2e go run ./e2e/sqfix strand <host> <body>
DATABASE_URL=…_e2e go run ./e2e/sqfix route <host> <body>
DATABASE_URL=…_e2e go run ./e2e/sqfix lapse <host> <body>
- age: moves the QUEUED message <body> for <host> back by <seconds> — its
created_at and the sign-in time it was queued under, together, so it was
authorized when it was queued. The dispatcher's own delivery then decides
what that age means (internal/api sendQueueAuthorization).
- strand: marks the QUEUED message <body> for <host> as being sent by a pod
that has stopped: claimed, its lease already run out. The dispatcher's
own Recover then fails it as "may have been delivered" on its next pass.
- route: marks the QUEUED message <body> for <host> as ROUTED, to a route
that does not exist (routeFixture). The dispatcher's own route gate then
fails it as "its route could not be read" — a failed routed row.
- lapse: runs the edit hold on the HELD message <body> for <host> out now
(held_until a second ago, on the database's clock) — what ten minutes of
an abandoned edit does.
Each refuses unless exactly one row matched: a fixture that silently moved nothing would let the spec test a state it never built.
🔴 IT REFUSES ANY DATABASE WHOSE NAME DOES NOT END IN "_e2e" (e2edb.Check): it writes as the login role with row-level security's scope set to all.