-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix: raycast org selection based api key creation #447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: raycast org selection based api key creation #447
Conversation
Deploying with
|
Status | Name | Latest Commit | Updated (UTC) |
---|---|---|---|
✅ Deployment successful! View logs |
supermemory-app | c3f1647 | Oct 03 2025, 08:02 AM |
How to use the Graphite Merge QueueAdd the label Main to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Code Review for PR #447SummaryThis PR fixes a race condition in the Raycast API key creation flow by ensuring the organization is loaded before triggering the mutation. ✅ Positive Aspects
🔍 Code Quality ObservationsGood:
Considerations:
|
PR Review: Fix Raycast org selection based API key creation✅ Positive ChangesGood catch on the null check! The fix properly addresses a potential runtime error when 🐛 Bugs & IssuesCritical: Race Condition in useEffect }, [searchParams, hasTriggeredRaycast, createRaycastApiKeyMutation, org])
// ^^^ The dependency Recommendation: useEffect(() => {
const qParam = searchParams.get("q")
if (
qParam === "raycast" &&
!hasTriggeredRaycast &&
!createRaycastApiKeyMutation.isPending &&
org?.id
) {
setHasTriggeredRaycast(true)
createRaycastApiKeyMutation.mutate()
}
}, [searchParams, hasTriggeredRaycast, createRaycastApiKeyMutation, org?.id])
// ^^^^^^^
// More precise dependency 🔒 Security ConcernsAPI Key Creation Without User Confirmation
Recommendations:
🎯 Code QualityInconsistent Error Handling const createApiKeyMutation = useMutation({
mutationFn: async () => {
if (!org?.id) {
throw new Error("Organization ID is required")
}
const res = await authClient.apiKey.create({
// ... rest of code
})
},
// ...
}) Minor: .gitignore Change According to your ⚡ Performance ConsiderationsNo significant performance issues. The early return guards are good practice and avoid unnecessary API calls. 🧪 Test CoverageMissing test scenarios:
Consider adding integration tests for the Raycast flow since it involves auto-triggering behavior. 📝 SummaryIssues to address:
The core fix is solid and addresses the immediate issue. The main concerns are around the security implications of automatic key creation and the lock file change. |
Merge activity
|
a5c054c
to
c3f1647
Compare
Pull Request Review: Raycast Organization Selection API Key CreationSummaryThis PR fixes a bug where Raycast API key creation could fail when the organization ID is not yet available. The changes add proper validation and defensive checks. ✅ Positive Aspects
🐛 Potential Issues1. Race Condition Still ExistsThe
Actually, this looks correct on second review ✅ 2.
|
No description provided.