Promote test to main#1699
Conversation
* feat: migrate getCatalogs to GET /api/accounts/{id}/catalogs
Repoints the chat caller off the legacy Agent API host onto the
new nested route on recoup-api.vercel.app. Adds Privy Bearer auth
and threads the access token through useCatalogs.
* fix: gate useCatalogs on auth readiness
Add `authenticated` from usePrivy() to the query's `enabled` flag so the
request doesn't fire with an empty Bearer token before Privy resolves.
Matches the canonical pattern in useAccountOrganizations.ts /
useSandboxes.ts.
Note: pnpm lint / typecheck not run — node_modules missing in worktree.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 48 minutes and 2 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
✨ 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.
1 issue found across 3 files
Confidence score: 3/5
- There is a concrete regression risk in
lib/catalog/getCatalogs.ts:accountIdis inserted into a URL path segment without encoding, which can cause malformed or misrouted requests for certain values. - Given the medium severity (6/10) and high confidence (9/10), this is more than a cosmetic issue and could impact users in real request flows.
- Pay close attention to
lib/catalog/getCatalogs.ts- ensureaccountIdis URL-encoded before path construction to prevent routing errors.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="lib/catalog/getCatalogs.ts">
<violation number="1" location="lib/catalog/getCatalogs.ts:24">
P2: Encode `accountId` before inserting it into the URL path segment to avoid malformed or misrouted requests.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| try { | ||
| const response = await fetch( | ||
| `https://api.recoupable.com/api/catalogs?account_id=${accountId}`, | ||
| `${getClientApiBaseUrl()}/api/accounts/${accountId}/catalogs`, |
There was a problem hiding this comment.
P2: Encode accountId before inserting it into the URL path segment to avoid malformed or misrouted requests.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At lib/catalog/getCatalogs.ts, line 24:
<comment>Encode `accountId` before inserting it into the URL path segment to avoid malformed or misrouted requests.</comment>
<file context>
@@ -1,25 +1,34 @@
try {
const response = await fetch(
- `https://api.recoupable.com/api/catalogs?account_id=${accountId}`,
+ `${getClientApiBaseUrl()}/api/accounts/${accountId}/catalogs`,
{
method: "GET",
</file context>
| `${getClientApiBaseUrl()}/api/accounts/${accountId}/catalogs`, | |
| `${getClientApiBaseUrl()}/api/accounts/${encodeURIComponent(accountId)}/catalogs`, |
Promotes
testtomain.Included
99a7feb6)testsince the last promotion.This is the chat-side complement of recoupable/api#464 and recoupable/docs#153 (both already on main).
🤖 Generated with Claude Code
Summary by cubic
Promotes
testtomain, migrating catalog fetching to the new/api/accounts/{id}/catalogsroute with Privy Bearer auth. Replaces the legacy query-param endpoint and aligns chat with the current API.New Features
${getClientApiBaseUrl()}/api/accounts/{accountId}/catalogsand sendAuthorization: Bearer <Privy token>.types/Catalog.tsand updategetCatalogs/useCatalogsto use the newCatalogtype.Bug Fixes
authenticatedfrom@privy-io/react-authand a valid account id to avoid firing requests without a token (@tanstack/react-query).Written for commit 99a7feb. Summary will update on new commits.