Skip to content

fix(mosaic): keep confirm dialogs busy until the action settles - #10628

Open
alexcarpenter wants to merge 1 commit into
carp/mosaic-form-submit-pendingfrom
carp/mosaic-confirm-pending
Open

alexcarpenter wants to merge 1 commit into
carp/mosaic-form-submit-pendingfrom
carp/mosaic-confirm-pending

Conversation

@alexcarpenter

@alexcarpenter alexcarpenter commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Description

Part 2 of 4. docs/controllers.md says a controller holds the surface still while an action runs. The confirm controller didn't: cancelling a reverification prompt mid-run dropped it to idle while the request was still in flight, so it reported not-pending and could be opened and confirmed again.

  • Cancel while pending closes the dialog but stays pending until the run settles.
  • Open and confirm are ignored while a run is pending.

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

@vercel

vercel Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
clerk-js-sandbox Ready Ready Preview Nov 4, 2026 12:53am UTC
swingset Ready Ready Preview Nov 4, 2026 12:53am UTC

Request Review

@changeset-bot

changeset-bot Bot commented Nov 4, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9a8ac75

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

This PR includes changesets to release 2 packages
Name Type
@clerk/mosaic Patch
@clerk/swingset 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

@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

The confirm controller now tracks dialog visibility independently from the action state. Canceling a pending action closes the dialog while the action remains pending. If the action later rejects after the dialog closes, the controller returns to idle without an error. Tests cover pending cancellation and cancellation during reverification.

Estimated code review effort: 2 (Simple) | ~12 minutes

Possibly related PRs

  • clerk/javascript#10481: Updates confirm actions and tests to keep the underlying action pending until it settles after dialog cancellation.

Suggested reviewers: ephem

Merge Risk: Minimal · up to 9a8ac

Cancellation hides the dialog while the action settles. No material merge risk remains.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title names the main behavior change: the confirm dialog stays busy (pending) until the action settles. The raw summary confirms the controller now keeps pending state after cancel and ignores ope…
Description check Passed The description states the problem and the fix. Cancelling a reverification prompt during a run dropped the confirm controller to idle while the request was in flight. The fix keeps it pending until t…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main behavior change: the confirm dialog stays busy (pending) until the action settles. The raw summary confirms the controller now keeps pending state after cancel and ignores open/confirm during a run. The title is specific and accurate, and the fix(mosaic) prefix matches the changed package.

Full details: Description check

Explanation

The description states the problem and the fix. Cancelling a reverification prompt during a run dropped the confirm controller to idle while the request was in flight. The fix keeps it pending until the run settles and ignores open and confirm during a pending run. This matches the confirm controller changes, the test updates, and the changeset in the summary.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 2 files. (1 skipped: 1 unsupported.)

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Linked repositories: Some configured repositories could not be included in this review. Cross-repository analysis may be incomplete. Please check linked-repository access and settings.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between ce3afe1 and 9a8ac75.

Files selected for processing: 3
  • .changeset/mosaic-confirm-pending.md
  • packages/mosaic/src/blocks/confirm/__tests__/confirm.controller.test.ts
  • packages/mosaic/src/blocks/confirm/confirm.controller.ts
Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.

@pkg-pr-new

pkg-pr-new Bot commented Nov 4, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@10628

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@10628

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@10628

@clerk/expo

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

@clerk/expo-biometrics

npm i https://pkg.pr.new/@clerk/expo-biometrics@10628

@clerk/expo-google-signin

npm i https://pkg.pr.new/@clerk/expo-google-signin@10628

@clerk/expo-native-components

npm i https://pkg.pr.new/@clerk/expo-native-components@10628

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@10628

@clerk/localizations

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

@clerk/mosaic

npm i https://pkg.pr.new/@clerk/mosaic@10628

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: 9a8ac75

@blacksmith-sh

blacksmith-sh Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Matches Cancelled reverification can't be reopened mid-run

After cancelling the password prompt mid-run, the dialog closes but stays pending, and clicking the trigger again does nothing until the run settles. Before, it dropped to not-pending at once, reopened, and a second confirm started another run.

Recording

Watch full video · Original footage · 0:00 Confirm into reverification · 0:08 Cancel the password prompt · 0:13 Reopen while the run is pending · 0:23 Let the cancelled run settle · 0:28 Reopen after the run settles

Merge-baseThis PR 9a8ac750
State after cancelState after cancel

Before: reopened, second run

Also checked · 1 match

Matches Dialog reopens once the cancelled run settles

Proof on 9a8ac750 · Did Proof get it right? Yes · No

View full Proof report

This branch was successfully deployed

2 active deployments
Preview – swingset — 9a8ac750 Deployed Nov 4, 2026 by vercel[bot]
Preview – clerk-js-sandbox — 9a8ac750 Deployed Nov 4, 2026 by vercel[bot]
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.

1 participant