Repository navigation
Conversation
Several edge function examples returned errors as { msg: ... }, which
doesn't match the shape Supabase's own tooling expects (platform
gateway, self-hosted worker, Studio's test panel all use
{ error: ... }, see supabase#47835). A developer copying these examples would
hit the same generic-error symptom, just caused by their own function.
The _shared/jwt/* middlewares are imported by multiple example
functions, so fixing them covers every example that uses
AuthMiddleware, not just sentryfied.
|
Thanks for contributing to Supabase! ❤️ Our team will review your PR. A few tips for a smoother review process:
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@shkuls is attempting to deploy a commit to the Supabase Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughJWT middleware and Sentry Edge Functions now return error payloads under ChangesError response standardization
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related issues
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@examples/edge-functions/supabase/functions/sentryfied/index.ts`:
- Line 28: Update the remaining 500 response in the Sentry edge function so its
response body uses the error key instead of msg, preserving the existing error
value and status; leave the oak-server msg response unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 367c75e6-ea55-4219-ab76-edce3d5ff6ef
📒 Files selected for processing (4)
examples/edge-functions/supabase/functions/_shared/jwt/clerk.tsexamples/edge-functions/supabase/functions/_shared/jwt/default.tsexamples/edge-functions/supabase/functions/_shared/jwt/legacy-jwt.tsexamples/edge-functions/supabase/functions/sentryfied/index.ts
Same msg/error inconsistency as the other examples fixed in this PR, flagged by review on the 500 response in the Sentry Functions Challenge example.
I have read the CONTRIBUTING.md file.
YES
What kind of change does this PR introduce?
Docs update
What is the current behavior?
Several edge function examples (
examples/edge-functions/supabase/functions/sentryfied/index.ts, and the shared JWT auth middlewares_shared/jwt/default.ts,_shared/jwt/clerk.ts,_shared/jwt/legacy-jwt.ts) return errors as{ "msg": "..." }. This doesn't match the shape Supabase's own tooling expects (platform gateway, self-hosted worker, Studio's test panel all use{ "error": "..." }) — see #47835 for the full writeup of this pattern across the codebase. A developer copying any of these would hit the same "generic unhelpful error" symptom that issue describes, just caused by their own function.The three
_shared/jwt/*files are auth middleware imported by multiple example functions, so fixing them there covers every example that usesAuthMiddlewarefrom any of the three, not just the one function that imports it directly.What is the new behavior?
All four return
{ "error": "..." }instead, matching platform's shape and the now-fixed self-hosted/CLI workers.Additional context
Related to #47835. Not a functional bug in any of these examples (JWT verification and Sentry capture still work either way), just aligning the taught pattern with what Supabase's own tooling actually expects.
Summary by CodeRabbit
errorfield instead ofmsg.{ error: ... }JSON when failures occur.