Repository navigation
feat(server): a request wide event for every route - #488
Merged
Merged
Conversation
allisonmahmood
force-pushed
the
t3code/implement-issue-37
branch
2 times, most recently
from
October 2, 2026 20:37
08b055d to
0b9a396
Compare
Only /api/runtime/* produced wide events; publish, the portal, sign-in, device login, connections, patch serving and the SDK left no trace. Route middleware now opens one request event per routed request, named by the matched template, never the URL. The outcome follows the status the client received, and a refusal carries its body's code. The API guard records its own answers under /api/*. Runtime routes keep their own events, and health probes emit none. Auth, Patches, Serving and Portal name the viewer, company, patch and version where they resolve them. Closes #37. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A request the server answers itself, such as a query that does not decode, failed the event's exit and was recorded as a failure. The event now closes over the exit and takes its outcome from the response the server derives, then raises the cause again for the server to answer and report. A replayed publish names its patch and version, the guard picks one bucket, and the tests decode bodies and check more of what must stay off events. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A target the router could not decode failed before even the `/*` fallback and left no event; an outermost middleware now records it there, and keeps the method the client sent, since Serving answers HEAD as GET before routing. Recording a response now survives the handler's interruption. Routes about one patch record its current version, and a rollback the version it made current. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Retire, restore, describe and delete answered with the patch but recorded only its id; they now record its current version too, as reads do. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…sion Sharing and reading the inventory recorded only the patch id. setScope now returns the patch's id and current version with its scope, and the inventory read records them where it locks the row, so every route about one patch names a version. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
allisonmahmood
force-pushed
the
t3code/implement-issue-37
branch
from
October 2, 2026 21:07
0b9a396 to
370c293
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When someone says "publish failed", there's nothing to look at: only
/api/runtime/*produced wide events. Publish, the portal, sign-in, device login, connections, served pages and the SDK tarball left no trace.Now every request outside the runtime path emits one
type: "request"event through the existingWideEventsservice (stdout for CloudWatch, plus PostHog):route(e.g./api/patches/:patchRef,/:company/:name/*, or/*//api/*for unmatched requests),methodandstatus. Two things happen before routing and are recorded at the edge: the API guard's own answers go under/api/*(with the refusinglimitIdon a 429), and a target the router can't decode at all goes under/*. The edge also keeps the method the client sent, since Serving answers HEAD as GET.code, 5xx failure, interruption interrupted (with the status the server answers). This includes responses the server derives from a failed exit, such as a query that doesn't decode (400, refused); the cause is re-raised outside the event, so the server's response and error reporting are unchanged.viewerIdandcompanyId; publish (including replays), served pages, patch reads, portal pages and:patchIdroutes addpatchId, andversionIdfor the version served, created or current (a rollback records the one it made current). Tokens, cookies, codes, bodies, filenames and paths never reach an event; a test pins that across a publish, a cookie page view and a full device-login exchange./healthzemits nothing.docs/OPERATIONS.mddescribes the events and how to find one in CloudWatch Logs Insights. It says "the host service's log group" until #415 names it.One side effect: the guard doesn't classify
PUT /api/runtime/staged-files/…orGET /api/runtime/file-handles/…as runtime, so a 429 on those now emits a guard event under/api/*where nothing was recorded before. It never doubles a runtime event.Closes #37
Made by Claude Opus 5.5 via Claude Code; reviewed by GPT 6.1 Sol via codex.