Skip to content

fix(ui): throttle self-serve SSO domain verification retries - #9275

Open
NicolasLopes7 wants to merge 2 commits into
mainfrom
nicolas/retry-sso-domain-verification
Open

fix(ui): throttle self-serve SSO domain verification retries#9275
NicolasLopes7 wants to merge 2 commits into
mainfrom
nicolas/retry-sso-domain-verification

Conversation

@NicolasLopes7

Copy link
Copy Markdown
Contributor

Summary

  • show the domain verification retry action while a self-serve SSO domain is pending or expired
  • throttle each domain retry for five minutes, including when a retrigger changes the domain from expired to pending
  • add coverage for retry visibility and cooldown behavior

Testing

  • pnpm --filter @clerk/ui exec vitest run src/components/ConfigureSSO/tests/ConfigureSSO.test.tsx
  • pnpm --filter @clerk/ui exec eslint src/components/ConfigureSSO/steps/OrganizationDomainsStep.tsx src/components/ConfigureSSO/tests/ConfigureSSO.test.tsx

@changeset-bot

changeset-bot Bot commented Jul 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8603802

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

This PR includes changesets to release 3 packages
Name Type
@clerk/ui Patch
@clerk/chrome-extension 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

@vercel

vercel Bot commented Jul 29, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment Jul 29, 2026 6:42pm
swingset Ready Ready Preview, Comment Jul 29, 2026 6:42pm

Request Review

@pkg-pr-new

pkg-pr-new Bot commented Jul 29, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/electron

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

@clerk/electron-passkeys

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

@clerk/eslint-plugin

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

@clerk/expo

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

@clerk/expo-google-signin

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/hono

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: 8603802

@NicolasLopes7
NicolasLopes7 marked this pull request as ready for review July 29, 2026 18:39
@github-actions

Copy link
Copy Markdown
Contributor

API Changes Report

Generated by Break Check on 2026-07-29T18:43:57.225Z

Summary

Metric Count
Packages analyzed 19
Packages with changes 0
🔴 Breaking changes 0
🟡 Non-breaking changes 0
🟢 Additions 0

No API Changes Detected

All packages have stable APIs with no detected changes.


Report generated by Break Check

Last ran on 8603802.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 95e03a23-adfb-40eb-8757-3518112e8410

📥 Commits

Reviewing files that changed from the base of the PR and between c86b4bc and 8603802.

📒 Files selected for processing (3)
  • .changeset/bright-trees-retry.md
  • packages/ui/src/components/ConfigureSSO/__tests__/ConfigureSSO.test.tsx
  • packages/ui/src/components/ConfigureSSO/steps/OrganizationDomainsStep.tsx
🔗 Linked repositories identified

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

  • clerk/clerk_go (manual)
  • clerk/dashboard (manual)
  • clerk/accounts (manual)
  • clerk/backoffice (manual)
  • clerk/clerk (manual)
  • clerk/clerk-docs (manual)
  • clerk/cloudflare-workers (manual)
  • clerk/cli (auto-detected)
  • clerk/clerk-ios (auto-detected)
  • clerk/clerk-android (auto-detected)
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/ui/src/components/ConfigureSSO/steps/OrganizationDomainsStep.tsx
  • packages/ui/src/components/ConfigureSSO/tests/ConfigureSSO.test.tsx

📝 Walkthrough

Walkthrough

ConfigureSSO adds ownership-verification retry handling with a five-minute throttle, shared retry controls for expired and unverified TXT-record states, timer cleanup, and tests covering retry visibility, invocation, disabled state, and cooldown re-enabling. A patch changeset documents the behavior.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: throttling self-serve SSO domain verification retries.
Description check ✅ Passed The description matches the changeset and accurately summarizes the retry visibility, cooldown, and tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

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

Comment on lines +382 to +384
const retryTimerRef = useRef<number | undefined>(undefined);
const isVerificationRetryThrottledRef = useRef(false);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

what's the thinking behind the use of useRef to store timeouts? I feel like useState might be more appropriate but I'd like to understand more

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.

2 participants