-
Notifications
You must be signed in to change notification settings - Fork 409
fix(clerk-js): Do not open orgs prompt when choose-organization task is pending
#7307
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
Conversation
🦋 Changeset detectedLatest commit: 81c0597 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughPrevents the "enable organization" prompt from appearing when a session has a pending Changes
Sequence DiagramsequenceDiagram
participant User
participant ClerkApp as Clerk App
participant Session
participant EnvCheck as Org Feature Check
rect rgb(230, 240, 250)
Note over User,EnvCheck: Before fix — cached env causes prompt
User->>ClerkApp: Redirect after enabling organizations
ClerkApp->>Session: Load session (has choose-organization task)
Session-->>ClerkApp: Return pending task
ClerkApp->>EnvCheck: Check organizations setting
EnvCheck-->>ClerkApp: Feature appears disabled → show prompt
ClerkApp->>User: ❌ Enable organization prompt appears
end
rect rgb(240, 250, 240)
Note over User,EnvCheck: After fix — prompt suppressed during task
User->>ClerkApp: Redirect after enabling organizations
ClerkApp->>Session: Load session (has choose-organization task)
Session-->>ClerkApp: Return pending task
ClerkApp->>EnvCheck: Check organizations setting
EnvCheck->>EnvCheck: Is current task == "choose-organization"?
EnvCheck-->>ClerkApp: Treat as enabled → suppress prompt
ClerkApp->>User: ✓ Continue to choose-organization
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10–15 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (3)
🧰 Additional context used📓 Path-based instructions (9)**/*.{js,jsx,ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Files:
**/*.{js,jsx,ts,tsx,json,md,yml,yaml}📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Files:
packages/**/src/**/*.{ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Files:
**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Files:
packages/**/src/**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Files:
**/*.ts?(x)📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Files:
**/*.{ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/typescript.mdc)
Files:
**/*.{test,spec}.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Files:
**/*.{test,spec,e2e}.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Files:
🧬 Code graph analysis (2)packages/clerk-js/src/core/clerk.ts (1)
packages/clerk-js/src/core/__tests__/clerk.test.ts (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). (5)
🔇 Additional comments (4)
Comment |
87925d3 to
f416830
Compare
@clerk/agent-toolkit
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/elements
@clerk/clerk-expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/clerk-react
@clerk/react-router
@clerk/remix
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/themes
@clerk/types
@clerk/upgrade
@clerk/vue
commit: |
2f3d636 to
9419ce1
Compare
9419ce1 to
81c0597
Compare
Description
The environment resource is currently cached on the network level, therefore, when enabling orgs via BAPI, and coming back to the app, the session gets updated to have a session task but it could still have
organizationSettings.enabled=falseThis PR introduces an additional check to only trigger the prompt if there's not a
choose-organizationtaskThe
choose-organizationtask only gets added once orgs are enabledChecklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.