fix: add granular auth error types for better debugging#161
Merged
arpandhakal merged 3 commits intomainfrom Mar 20, 2026
Merged
fix: add granular auth error types for better debugging#161arpandhakal merged 3 commits intomainfrom
arpandhakal merged 3 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
arpandhakal
approved these changes
Mar 20, 2026
AssemblyNoTokenError was used for three different failure modes, making it impossible to tell from logs whether the token was missing, unparseable, or if the proxy failed to inject headers. Adds AssemblyTokenParseError and AssemblyMissingHeadersError to distinguish between these cases, with structured logging on each. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
getImageUrl was returning URLs with token= (empty) and filePath=undefined when called before the app-bridge had received a token or when banner path was undefined. The browser would fetch these broken URLs, the proxy would throw AssemblyNoTokenError, and the Server Components render would crash — killing the whole page. Now returns undefined when token or path is missing, with logging to help diagnose why the token isn't available. All callers updated to skip rendering Banner when no valid URL is available. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1ed7898 to
1d920c6
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.
Summary
AssemblyNoTokenErrorwas used for three different failure modes, making it impossible to diagnose auth issues from logsAssemblyTokenParseError— token is present in the URL but fails Zod validation (empty string, wrong format)AssemblyMissingHeadersError— proxy didn't inject auth headers, so server components can't authenticateAssemblyMissingHeadersErrorinstead ofAssemblyNoTokenErrorsince they check headers, not query paramsTest plan
?token=param — should seeAssemblyNoTokenErrorin logs with URL context?token=— should seeAssemblyTokenParseErrorin logsAssemblyMissingHeadersErrorin logs🤖 Generated with Claude Code