fix(logging): include URL params and simplify TRPCError cause#747
Merged
danadajian merged 2 commits intomainfrom Mar 26, 2026
Merged
fix(logging): include URL params and simplify TRPCError cause#747danadajian merged 2 commits intomainfrom
danadajian merged 2 commits intomainfrom
Conversation
…ror logs Parses the Referer header in the onError handler to extract all SPA URL parameters (commitHash, owner, repo, bucket, etc.) and merges them into every error log entry — even for procedures that don't receive all params as input. Simplifies TRPCError cause fields from objects to plain event name strings. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
🎉 This PR is included in version 1.41.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
Summary
Refererheader in theonErrorhandler to extract all SPA URL parameters (commitHash,owner,repo,bucket, etc.) and spreads them into every error log entryfetchCurrentPage) that don't receiveowner/repoas tRPC inputsTRPCErrorcausefields from objects ({ event: 'FOO', owner, repo, ... }) to plain event name strings ('FOO') — the extra context is now sourced from the URL paramsChanges
app/server.ts—onErrornow extractsurlParamsfromreq.headers.get('referer')and logs them alongsidecause;inputremoved (superseded by URL params)app/backend/src/fetchCurrentPage.ts—causesimplified to string in both throwsapp/backend/src/getGroupedKeys.ts—causesimplified to string in both throwsapp/backend/src/acceptVisualChanges.ts—causesimplified to string in both throwsapp/backend/src/getOctokit.ts—causesimplified to string in all three throwsapp/backend/src/updateCommitStatus.ts—causesimplified to stringTest plan
fetchCurrentPageerror (e.g. invalid hash) and verify the server log includesowner,repo,bucket,commitHashfrom the browser URL alongside thecauseevent namebun tsc)Generated with Claude Code