Merge Test to Main#1600
Conversation
added bearer header to tasks api
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR integrates Privy authentication into the task management system by modifying the Changes
Sequence DiagramsequenceDiagram
actor User
participant Hook as useScheduledActions
participant Privy as Privy Auth
participant Fetch as getTasks
participant API as Backend API
User->>Hook: Trigger query (e.g., render)
rect rgba(100, 150, 200, 0.5)
Hook->>Privy: Check authenticated state
Privy-->>Hook: authenticated status
end
alt authenticated = true
rect rgba(150, 200, 100, 0.5)
Hook->>Privy: getAccessToken()
Privy-->>Hook: accessToken
end
Hook->>Fetch: getTasks(accessToken, filters)
rect rgba(200, 150, 100, 0.5)
Fetch->>API: POST /api/tasks<br/>(Authorization: Bearer {token})
API-->>Fetch: Task[] response
end
Fetch-->>Hook: Task[]
Hook-->>User: Render tasks
else authenticated = false
Hook-->>User: Skip query (disabled)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6c010589c0
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| throw new Error("Please sign in to view scheduled actions"); | ||
| } | ||
|
|
||
| return getTasks(accessToken, { |
There was a problem hiding this comment.
Scope scheduled-actions cache by authenticated user
This query now returns token-scoped data (getTasks(accessToken, ...)) but the cache key still excludes user identity, so a logout/login in the same tab can reuse the previous account’s cached tasks until the refetch completes. Because QueryClient is process-wide (providers/Providers.tsx) and signOut does not clear React Query cache (hooks/useUser.tsx), the next authenticated user can briefly see another user’s scheduled actions. Include a user discriminator in the query key (or clear this query on logout) to prevent cross-user cache bleed.
Useful? React with 👍 / 👎.
Summary by CodeRabbit