Skip to content

Conversation

@octoper
Copy link
Member

@octoper octoper commented Dec 12, 2025

Description

This fixes a previously introduced bug that was not awaiting the navigateOnSetActive in setActive called on password submit on sign-in

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Summary by CodeRabbit

  • Bug Fixes

    • Await navigation after password sign-in completes so post-sign-in redirects reliably finish before the app continues, reducing navigation races and improving sign-in consistency.
  • Chores

    • Added release metadata indicating a patch-level change; no public API changes.

✏️ Tip: You can customize this high-level summary in your review settings.

@octoper octoper requested a review from Ephem December 12, 2025 14:05
@changeset-bot
Copy link

changeset-bot bot commented Dec 12, 2025

🦋 Changeset detected

Latest commit: ae6b856

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@clerk/ui Patch
@clerk/chrome-extension Patch

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

@vercel
Copy link

vercel bot commented Dec 12, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment Dec 15, 2025 9:34am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 12, 2025

Walkthrough

Adds a changeset file and updates the sign-in password card so its 'complete' navigate handler awaits and returns the result of navigateOnSetActive instead of discarding it.

Changes

Cohort / File(s) Change Summary
Changeset metadata
\.changeset/wise-ghosts-battle.md
Added a new changeset declaring a patch for @clerk/ui and noting a fix to await navigation after password sign-in.
Sign-in component
packages/ui/src/components/SignIn/SignInFactorOnePasswordCard.tsx
Converted the 'complete' navigate handler to async and return/await the result of navigateOnSetActive, ensuring navigation is awaited and its result is propagated.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify callers/consumers of the navigate handler tolerate a Promise return value or are updated accordingly.
  • Confirm tests cover the awaited navigation path and any error propagation.

Poem

🐰 I hopped through code with a twitch and wink,
Turned a quick skip into a thoughtful blink,
Awaiting the path before I bound,
So redirects finish safe and sound. 🥕

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: awaiting navigation after password submission during sign-in, which directly corresponds to the code changes in SignInFactorOnePasswordCard.tsx.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch vaggelis/respect-the-promise-on-password-submit

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 0761565 and ae6b856.

📒 Files selected for processing (2)
  • .changeset/wise-ghosts-battle.md (1 hunks)
  • packages/ui/src/components/SignIn/SignInFactorOnePasswordCard.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • .changeset/wise-ghosts-battle.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/ui/src/components/SignIn/SignInFactorOnePasswordCard.tsx
⏰ 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). (19)
  • GitHub Check: Static analysis
  • GitHub Check: Unit Tests (**)
  • GitHub Check: Integration Tests (machine, chrome, RQ)
  • GitHub Check: Integration Tests (nextjs, chrome, 16, RQ)
  • GitHub Check: Integration Tests (quickstart, chrome, 16)
  • GitHub Check: Integration Tests (nextjs, chrome, 16)
  • GitHub Check: Integration Tests (machine, chrome)
  • GitHub Check: Integration Tests (custom, chrome)
  • GitHub Check: Integration Tests (quickstart, chrome, 15)
  • GitHub Check: Integration Tests (nextjs, chrome, 15)
  • GitHub Check: Integration Tests (billing, chrome)
  • GitHub Check: Integration Tests (billing, chrome, RQ)
  • GitHub Check: Integration Tests (astro, chrome)
  • GitHub Check: Integration Tests (generic, chrome)
  • GitHub Check: Integration Tests (sessions:staging, chrome)
  • GitHub Check: Integration Tests (sessions, chrome)
  • GitHub Check: Integration Tests (localhost, chrome)
  • GitHub Check: Integration Tests (ap-flows, chrome)
  • GitHub Check: semgrep-cloud-platform/scan

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/ui/src/components/SignIn/SignInFactorOnePasswordCard.tsx (1)

72-115: Good: return/await navigation promise from navigate callback. This aligns with the bug fix intent where setActive(...).navigate(...) can now await navigateOnSetActive(...).

However, there's a real concern to address: if navigateOnSetActive rejects (due to router/navigation failure), the .catch(err => ...) block will treat it like an authentication error. It will skip the specific error checks (isUserLockedError, isPasswordPwnedError, isPasswordCompromisedError) and fall through to handleError(), which treats the failure as a password error. Consider either:

  • Adding a guard to distinguish navigation errors from auth errors in the catch block, or
  • Wrapping the navigation callback to handle rejection separately and not propagate it to the outer catch.
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between cfd0cba and a88b6af.

📒 Files selected for processing (2)
  • .changeset/wise-ghosts-battle.md (1 hunks)
  • packages/ui/src/components/SignIn/SignInFactorOnePasswordCard.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (12)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

All code must pass ESLint checks with the project's configuration

Files:

  • packages/ui/src/components/SignIn/SignInFactorOnePasswordCard.tsx
**/*.{js,jsx,ts,tsx,json,md,yml,yaml}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use Prettier for consistent code formatting

Files:

  • packages/ui/src/components/SignIn/SignInFactorOnePasswordCard.tsx
packages/**/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

TypeScript is required for all packages

Files:

  • packages/ui/src/components/SignIn/SignInFactorOnePasswordCard.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Follow established naming conventions (PascalCase for components, camelCase for variables)

Files:

  • packages/ui/src/components/SignIn/SignInFactorOnePasswordCard.tsx
packages/**/src/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

packages/**/src/**/*.{ts,tsx,js,jsx}: Maintain comprehensive JSDoc comments for public APIs
Use tree-shaking friendly exports
Validate all inputs and sanitize outputs
All public APIs must be documented with JSDoc
Use dynamic imports for optional features
Provide meaningful error messages to developers
Include error recovery suggestions where applicable
Log errors appropriately for debugging
Lazy load components and features when possible
Implement proper caching strategies
Use efficient data structures and algorithms
Implement proper logging with different levels

Files:

  • packages/ui/src/components/SignIn/SignInFactorOnePasswordCard.tsx
**/*.ts?(x)

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use proper TypeScript error types

Files:

  • packages/ui/src/components/SignIn/SignInFactorOnePasswordCard.tsx
**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

**/*.tsx: Use error boundaries in React components
Minimize re-renders in React components

**/*.tsx: Use proper type definitions for props and state in React components
Leverage TypeScript's type inference where possible in React components
Use proper event types for handlers in React components
Implement proper generic types for reusable React components
Use proper type guards for conditional rendering in React components

Files:

  • packages/ui/src/components/SignIn/SignInFactorOnePasswordCard.tsx
**/*.{md,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Update documentation for API changes

Files:

  • packages/ui/src/components/SignIn/SignInFactorOnePasswordCard.tsx
**/*.{jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/react.mdc)

**/*.{jsx,tsx}: Always use functional components with hooks instead of class components
Follow PascalCase naming for components (e.g., UserProfile, NavigationMenu)
Keep components focused on a single responsibility - split large components
Limit component size to 150-200 lines; extract logic into custom hooks
Use composition over inheritance - prefer smaller, composable components
Export components as named exports for better tree-shaking
One component per file with matching filename and component name
Separate UI components from business logic components
Use useState for simple state management in React components
Use useReducer for complex state logic in React components
Implement proper state initialization in React components
Use proper state updates with callbacks in React components
Implement proper state cleanup in React components
Use Context API for theme/authentication state management
Implement proper state persistence in React applications
Use React.memo for expensive components
Implement proper useCallback for handlers in React components
Use proper useMemo for expensive computations in React components
Implement proper virtualization for lists in React components
Use proper code splitting with React.lazy in React applications
Implement proper cleanup in useEffect hooks
Use proper refs for DOM access in React components
Implement proper event listener cleanup in React components
Use proper abort controllers for fetch in React components
Implement proper subscription cleanup in React components
Use proper HTML elements for semantic HTML in React components
Implement proper ARIA attributes for accessibility in React components
Use proper heading hierarchy in React components
Implement proper form labels in React components
Use proper button types in React components
Implement proper focus management for keyboard navigation in React components
Use proper keyboard shortcuts in React components
Implement proper tab order in React components
Use proper ...

Files:

  • packages/ui/src/components/SignIn/SignInFactorOnePasswordCard.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/typescript.mdc)

**/*.{ts,tsx}: Always define explicit return types for functions, especially public APIs
Use proper type annotations for variables and parameters where inference isn't clear
Avoid any type - prefer unknown when type is uncertain, then narrow with type guards
Implement type guards for unknown types using the pattern function isType(value: unknown): value is Type
Use interface for object shapes that might be extended
Use type for unions, primitives, and computed types
Prefer readonly properties for immutable data structures
Use private for internal implementation details in classes
Use protected for inheritance hierarchies
Use public explicitly for clarity in public APIs
Use mixins for shared behavior across unrelated classes in TypeScript
Use generic constraints with bounded type parameters like <T extends { id: string }>
Use utility types like Omit, Partial, and Pick for data transformation instead of manual type construction
Use discriminated unions instead of boolean flags for state management and API responses
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation at the type level
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Document functions with JSDoc comments including @param, @returns, @throws, and @example tags
Create custom error classes that extend Error for specific error types
Use the Result pattern for error handling instead of throwing exceptions
Use optional chaining (?.) and nullish coalescing (??) operators for safe property access
Let TypeScript infer obvious types to reduce verbosity
Use const assertions with as const for literal types
Use satisfies operator for type checking without widening types
Declare readonly arrays and objects for immutable data structures
Use spread operator and array spread for immutable updates instead of mutations
Use lazy loading for large types...

Files:

  • packages/ui/src/components/SignIn/SignInFactorOnePasswordCard.tsx
**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Use ESLint with custom configurations tailored for different package types

Files:

  • packages/ui/src/components/SignIn/SignInFactorOnePasswordCard.tsx
**/*.{js,ts,jsx,tsx,json,md,yml,yaml}

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Use Prettier for code formatting across all packages

Files:

  • packages/ui/src/components/SignIn/SignInFactorOnePasswordCard.tsx
⏰ 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). (28)
  • GitHub Check: Unit Tests (shared, clerk-js, RQ)
  • GitHub Check: Unit Tests (**)
  • GitHub Check: Publish with pkg-pr-new
  • GitHub Check: Static analysis
  • GitHub Check: Integration Tests (vue, chrome)
  • GitHub Check: Integration Tests (sessions, chrome)
  • GitHub Check: Integration Tests (astro, chrome)
  • GitHub Check: Integration Tests (tanstack-react-start, chrome)
  • GitHub Check: Integration Tests (machine, chrome)
  • GitHub Check: Integration Tests (billing, chrome)
  • GitHub Check: Integration Tests (quickstart, chrome, 15)
  • GitHub Check: Integration Tests (nextjs, chrome, 15)
  • GitHub Check: Integration Tests (nextjs, chrome, 16, RQ)
  • GitHub Check: Integration Tests (machine, chrome, RQ)
  • GitHub Check: Integration Tests (nextjs, chrome, 16)
  • GitHub Check: Integration Tests (custom, chrome)
  • GitHub Check: Integration Tests (handshake, chrome)
  • GitHub Check: Integration Tests (nuxt, chrome)
  • GitHub Check: Integration Tests (billing, chrome, RQ)
  • GitHub Check: Integration Tests (localhost, chrome)
  • GitHub Check: Integration Tests (handshake:staging, chrome)
  • GitHub Check: Integration Tests (quickstart, chrome, 16)
  • GitHub Check: Integration Tests (react-router, chrome)
  • GitHub Check: Integration Tests (generic, chrome)
  • GitHub Check: Integration Tests (express, chrome)
  • GitHub Check: Integration Tests (ap-flows, chrome)
  • GitHub Check: Integration Tests (sessions:staging, chrome)
  • GitHub Check: semgrep-cloud-platform/scan

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 12, 2025

Open in StackBlitz

@clerk/agent-toolkit

npm i https://pkg.pr.new/@clerk/agent-toolkit@7443

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@7443

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@7443

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@7443

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@7443

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@7443

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@7443

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@7443

@clerk/express

npm i https://pkg.pr.new/@clerk/express@7443

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@7443

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@7443

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@7443

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@7443

@clerk/react

npm i https://pkg.pr.new/@clerk/react@7443

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@7443

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@7443

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@7443

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@7443

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@7443

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@7443

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@7443

commit: ae6b856

Copy link
Contributor

@Ephem Ephem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

Comment on lines 81 to 82
navigate: async ({ session }) => {
return navigateOnSetActive({ session, redirectUrl: afterSignInUrl });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: No need for both async and returning the promise from navigateOnSetActive here.

I'd go with either async + await or just returning the promise from navigateOnSetActive.

Copy link
Member Author

@octoper octoper Dec 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh forgot to remove that, cleaning this up now!

octoper and others added 4 commits December 15, 2025 11:33
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@octoper octoper force-pushed the vaggelis/respect-the-promise-on-password-submit branch from c5b0484 to ae6b856 Compare December 15, 2025 09:33
@octoper octoper enabled auto-merge (squash) December 15, 2025 09:38
@octoper octoper merged commit 80e19f2 into main Dec 15, 2025
99 of 103 checks passed
@octoper octoper deleted the vaggelis/respect-the-promise-on-password-submit branch December 15, 2025 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants