Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughTwo changes were made: OAuth client metadata colors were swapped to update visual branding, and a post-sign-in profile seeding mechanism was introduced to automatically create "self" records in specified collections after authentication. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Handler as Callback Handler
participant Session as Session Management
participant OAuth as OAuth Restoration
participant Agent as Agent Instance
participant ATP as AT Protocol API
Client->>Handler: GET /callback (with auth code)
Handler->>Session: Create session
Session-->>Handler: Session created
Handler->>OAuth: Restore OAuth session
OAuth-->>Handler: Session restored
Handler->>Agent: Instantiate Agent
Agent-->>Handler: Agent ready
Handler->>ATP: ensureProfileRecords (for each collection)
Note over ATP: Check for "self" record<br/>Create if missing
ATP-->>Handler: Records ensured (or silently fail)
Handler-->>Client: Sign-in complete
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
…Error AGENTS.md §17 #7 and §24 #8 both state explicitly that "4xx errors *can* echo upstream messages — those are usually validation a user can act on." The helper, however, was returning generic strings ("Bad request" / "Forbidden" / etc.) for every status, so every route using it surfaced opaque errors that masked actionable upstream detail. A user submitting an invalid group handle, for example, got "Bad request" instead of the upstream's "Handle must be at least 3 characters". The XRPC proxy already did the right thing (xrpc/route echoes for 4xx, generic for 5xx); this brings the shared helper in line with the documented policy and the XRPC proxy precedent. Also: clamp the upstream-supplied status to the valid HTTP range (200..599). The function previously trusted any integer on `err.status` / `err.statusCode`, which would pass through to NextResponse — caches and browsers handle non-standard codes inconsistently. Anything outside the valid range now collapses to 500. 5xx behavior is unchanged: still generic message, still logged. Echoed 4xx messages pass through a redactSecrets pass that strips Bearer tokens, DPoP material, and bare JWTs that the atproto SDK occasionally embeds in error messages. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
app.certified.actor.profileandapp.bsky.actor.profile"self" records exist; if not, create empty ones withcreatedAt. Best-effort (wrapped in try/catch, won't break sign-in).brand_colorto navy (#0F2544) andbackground_colorto white (#FFFFFF). The previous dark navy background made the ePDS's internally-derived body text nearly unreadable.Changes
src/app/api/auth/callback-handler/route.ts— AddedensureProfileRecords()helper called after session creationsrc/app/.well-known/oauth-client-metadata/route.ts— Flippedbrand_colorandbackground_colorvaluesSummary by CodeRabbit
New Features
Style