Skip to content

fix(js): keep a Device Intelligence result that arrives after the deadline - #10276

Merged
mwickett merged 4 commits into
mainfrom
mwickett/protect-keep-late-di-token
Oct 27, 2026
Merged

mwickett merged 4 commits into
mainfrom
mwickett/protect-keep-late-di-token

Conversation

@mwickett

@mwickett mwickett commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Description

ClerkJS waits a limited time for the Device Intelligence result before sending a sign-in or sign-up. A result that arrived after that wait was discarded, so a user who retried shortly afterwards could send the request without it again.

This PR keeps a late result so the next sign-in or sign-up on the page can use it. The request that already went out is unchanged, no request waits longer than before, and a late result is validated the same way as an on-time one.

Independent of #10275; each helps on its own.

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:

@vercel

vercel Bot commented Oct 16, 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 Oct 27, 2026 9:25pm UTC
swingset Ready Ready Preview Oct 27, 2026 9:25pm UTC

Request Review

@changeset-bot

changeset-bot Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 44d8a79

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

This PR includes changesets to release 4 packages
Name Type
@clerk/clerk-js Patch
@clerk/chrome-extension Patch
@clerk/electron Patch
@clerk/expo 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 Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 93dc1f4 and 44d8a79.

Files selected for processing: 1
  • packages/clerk-js/src/core/protectSession.ts
Linked repositories identified

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

Files with no reviewable changes: 1
  • packages/clerk-js/src/core/protectSession.ts

Included review availability: This review used your included allowance. 5 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 6 reviews per hour.

Walkthrough

ProtectSession now reads Device Intelligence results that arrive after the original request deadline. It can store a late token under the cross-tab lock when the token remains usable and meets the replacement rules. The tests cover late loader results, token replacement, lock retries, and results that do not qualify for storage.

Priority: Normal

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

Possibly related PRs

  • clerk/javascript#10275: Changes Protect token wait timing and lock polling in the same deadline and lock-wait path.

Suggested reviewers: zourzouvillys

Merge Risk: Minimal · up to 44d8a

Late results can be retained for a later request without extending the timed-out request. No actionable merge-blocking risk remains after normal checks.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: retaining a Device Intelligence result that arrives after the deadline.
Description check Passed The description directly explains the late-result behavior, validation, request timing, and intended effect on subsequent sign-in or sign-up requests.
Docstring Coverage Passed Docstring coverage is inconclusive: files from earlier reviews still need to be rechecked within the check's analysis limits. Not blocking.
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.
  • 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.

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

@pkg-pr-new

pkg-pr-new Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/electron

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

@clerk/electron-passkeys

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

@clerk/eslint-plugin

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

@clerk/expo

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

@clerk/expo-biometrics

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

@clerk/expo-google-signin

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

@clerk/expo-native-components

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/hono

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

@clerk/localizations

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

@clerk/mosaic

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: 44d8a79

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-23T15:22:51.731170Z 93dc1f4 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 93dc1f492a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/clerk-js/src/core/protectSession.ts Outdated
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

API Changes Report

Generated by Break Check on 2026-10-27T21:26:19.582Z

Summary

Metric Count
Packages analyzed 20
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 44d8a79.

@mwickett
mwickett merged commit 690edf2 into main Oct 27, 2026
93 of 94 checks passed
@mwickett
mwickett deleted the mwickett/protect-keep-late-di-token branch October 27, 2026 21:50

This branch was successfully deployed

2 active deployments
Preview – swingset — 44d8a790 Deployed Oct 27, 2026 by vercel[bot]
Preview – clerk-js-sandbox — 44d8a790 Deployed Oct 27, 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.

2 participants