Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughUpdated documentation examples to replace server-side Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
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.
Review by RecurseML
🔍 Review performed on 6b08d8b..6b2f9da
✨ No bugs found, your code is sparkling clean
✅ Files analyzed, no issues (1)
• docs/templates/others/convex.mdx
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
docs/templates/others/convex.mdx(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
- GitHub Check: Vercel Agent Review
- GitHub Check: docker
- GitHub Check: restart-dev-and-test
- GitHub Check: setup-tests
- GitHub Check: build (22.x)
- GitHub Check: check_prisma_migrations (22.x)
- GitHub Check: docker
- GitHub Check: lint_and_build (latest)
- GitHub Check: build (22.x)
- GitHub Check: all-good
- GitHub Check: Security Check
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
docs/templates/others/convex.mdx (1)
55-55: Re-check HTTP snippet: likely needs server app (request-backed token store).If
convexHttpClientis used server-side, prefer the server app so it can read cookies/session via the request-bound token store. If the guide targets a non-server context with an explicit token store, current line is acceptable. Please confirm. Similar to earlier feedback; updating method name to the current API.Suggested server-side variant:
-convexHttpClient.setAuth(stackClientApp.getConvexHttpClientAuth({ tokenStore: requestObject })); // HTTP, see Stack Auth docs for more information on tokenStore +convexHttpClient.setAuth(stackServerApp.getConvexHttpClientAuth({ tokenStore: requestObject })); // HTTP (server), tokenStore built from the requestTo ensure consistency across the repo and surface of truth in templates, run:
#!/bin/bash set -euo pipefail echo "Audit Convex docs/templates for HTTP auth call:" rg -n -C2 'convexHttpClient\.setAuth\(' docs templates packages || true echo "Confirm there are no remaining uses of getAuthForConvexHttpClient:" rg -n -C2 'getAuthForConvexHttpClient' || true
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
docs/templates/others/convex.mdx(1 hunks)packages/template/src/integrations/convex/component/README.md(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
packages/template/**
📄 CodeRabbit inference engine (AGENTS.md)
When modifying the SDK copies, make changes in packages/template (source of truth)
Files:
packages/template/src/integrations/convex/component/README.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
- GitHub Check: setup-tests
- GitHub Check: restart-dev-and-test
- GitHub Check: all-good
- GitHub Check: Vercel Agent Review
- GitHub Check: lint_and_build (latest)
- GitHub Check: build (22.x)
- GitHub Check: check_prisma_migrations (22.x)
- GitHub Check: build (22.x)
- GitHub Check: docker
- GitHub Check: docker
- GitHub Check: Security Check
🔇 Additional comments (2)
packages/template/src/integrations/convex/component/README.md (1)
34-35: Correct: use client app for browser/React.These two lines are right;
getConvexClientAuthshould come fromstackClientAppin browser and React.docs/templates/others/convex.mdx (1)
53-54: Correct: use client app for browser/React.Good fix;
getConvexClientAuthshould be called onstackClientApphere.
| convexHttpClient.setAuth(stackServerApp.getAuthForConvexHttpClient({ tokenStore: requestObject })); // HTTP, see Stack Auth docs for more information on tokenStore | ||
| convexClient.setAuth(stackClientApp.getConvexClientAuth({})); // browser JS | ||
| convexReactClient.setAuth(stackClientApp.getConvexClientAuth({})); // React | ||
| convexHttpClient.setAuth(stackClientApp.getConvexHttpClientAuth({ tokenStore: requestObject })); // HTTP, see Stack Auth docs for more information on tokenStore |
There was a problem hiding this comment.
🛠️ Refactor suggestion | 🟠 Major
🧩 Analysis chain
Confirm HTTP context: client vs server app for Convex HTTP.
If convexHttpClient runs on the server and needs a request-backed token store, you likely want the server app variant. If it’s intentionally used in a client-like environment with an explicit token store, current line is fine. Please verify.
Suggested server-side alternative (note updated method name):
-convexHttpClient.setAuth(stackClientApp.getConvexHttpClientAuth({ tokenStore: requestObject })); // HTTP, see Stack Auth docs for more information on tokenStore
+convexHttpClient.setAuth(stackServerApp.getConvexHttpClientAuth({ tokenStore: requestObject })); // HTTP (server), tokenStore built from the requestRun to verify API surface and find stale references:
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "Check where getConvexHttpClientAuth is defined/used:"
rg -n -C2 --type=ts 'getConvexHttpClientAuth\s*\(' || true
echo "Check whether both client and server apps expose it (interfaces/classes):"
rg -n -C3 --type=ts 'interface .*Client.*\{[^}]*getConvexHttpClientAuth' || true
rg -n -C3 --type=ts 'interface .*Server.*\{[^}]*getConvexHttpClientAuth' || true
rg -n -C3 --type=ts 'class .*Client.*\{[^}]*getConvexHttpClientAuth' || true
rg -n -C3 --type=ts 'class .*Server.*\{[^}]*getConvexHttpClientAuth' || true
echo "Find any stale method name:"
rg -n -C2 'getAuthForConvexHttpClient' || trueLength of output: 1829
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "Files under packages/template/src/lib/stack-app/apps:"
find packages/template/src/lib/stack-app/apps -type fLength of output: 660
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "Inspect server-app interface for getConvex methods:"
rg -n --type=ts 'getConvex' -C3 packages/template/src/lib/stack-app/apps/interfaces/server-app.ts || true
echo "Inspect server-app implementation for getConvex methods:"
rg -n --type=ts 'getConvex' -C3 packages/template/src/lib/stack-app/apps/implementations/server-app-impl.ts || trueLength of output: 108
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== server-app interface ==="
sed -n '1,200p' packages/template/src/lib/stack-app/apps/interfaces/server-app.ts
echo "=== server-app implementation ==="
sed -n '1,200p' packages/template/src/lib/stack-app/apps/implementations/server-app-impl.tsLength of output: 17420
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== README context lines 1-100 ==="
sed -n '1,100p' packages/template/src/integrations/convex/component/README.md || trueLength of output: 2075
Use StackServerApp for HTTP auth
Replace the client-app call with the server-app variant so you generate tokens with your secret key:
-convexHttpClient.setAuth(stackClientApp.getConvexHttpClientAuth({ tokenStore: requestObject }));
+convexHttpClient.setAuth(stackServerApp.getConvexHttpClientAuth({ tokenStore: requestObject }));📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| convexHttpClient.setAuth(stackClientApp.getConvexHttpClientAuth({ tokenStore: requestObject })); // HTTP, see Stack Auth docs for more information on tokenStore | |
| convexHttpClient.setAuth(stackServerApp.getConvexHttpClientAuth({ tokenStore: requestObject })); // HTTP, see Stack Auth docs for more information on tokenStore |
🤖 Prompt for AI Agents
packages/template/src/integrations/convex/component/README.md around line 36:
the example uses the client-app method to set HTTP auth which does not generate
tokens with the server secret; replace the call to use the server-app variant
(StackServerApp) so tokens are created with your secret key by invoking the
server-app getConvexHttpClientAuth and passing the same
tokenStore/requestObject.
High-level PR Summary
This PR fixes a documentation error in the Convex integration guide by correcting two incorrect references from
stackServerApptostackClientAppfor thegetConvexClientAuth()method calls in browser and React environments. The HTTP client example correctly remains usingstackClientAppas it was already accurate.⏱️ Estimated Review Time: 5-15 minutes
💡 Review Order Suggestion
docs/templates/others/convex.mdxImportant
Fixes incorrect method references in Convex integration docs to use
stackClientAppfor browser and React environments.convex.mdxandREADME.mdfromstackServerApptostackClientAppforgetConvexClientAuth()in browser and React environments.stackClientApp.getConvexHttpClientAuth()withtokenStoreparameter.convex.mdx.This description was created by
for 2e9c3f0. You can customize this summary. It will automatically update as commits are pushed.
Summary by CodeRabbit