Skip to content

test(expo): Stabilize native client clear token sync test#9016

Merged
wobsoriano merged 1 commit into
mainfrom
rob/fix-flaky-expo-test
Jun 26, 2026
Merged

test(expo): Stabilize native client clear token sync test#9016
wobsoriano merged 1 commit into
mainfrom
rob/fix-flaky-expo-test

Conversation

@wobsoriano

@wobsoriano wobsoriano commented Jun 26, 2026

Copy link
Copy Markdown
Member

Description

Fixes this flaky test by waiting for the initial native-to-JS bootstrap reload before clearing mocks in the Expo native client sync test. It prevents the native clear-token test from racing with bootstrap token-cache writes

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

    • Improved reliability when the device token is cleared, helping the app refresh resources more consistently after sign-in state changes.
  • Chores

    • Added release metadata for this update.

@changeset-bot

changeset-bot Bot commented Jun 26, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: cffa2ab

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

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

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 Jun 26, 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 Jun 26, 2026 7:15pm
swingset Ready Ready Preview, Comment Jun 26, 2026 7:15pm

Request Review

@coderabbitai

coderabbitai Bot commented Jun 26, 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), Repository UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: a8572176-0060-4bbb-a72c-ad22a1631e46

📥 Commits

Reviewing files that changed from the base of the PR and between 613ce76 and cffa2ab.

📒 Files selected for processing (2)
  • .changeset/pink-eggs-share.md
  • packages/expo/src/provider/__tests__/ClerkProvider.nativeClientSync.test.tsx

📝 Walkthrough

Walkthrough

A native client sync test now asserts that initial resources are reloaded before handling a cleared device token, and a changeset file was added.

Changes

Native client sync update

Layer / File(s) Summary
Test assertion and changeset note
packages/expo/src/provider/__tests__/ClerkProvider.nativeClientSync.test.tsx, .changeset/pink-eggs-share.md
The device-token-clearing test adds a waitFor assertion for __internal_reloadInitialResources before rerendering with deviceToken: null, and the changeset file now contains content.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • clerk/javascript#8929: Touches the same native sync flow and the __internal_reloadInitialResources behavior covered by the updated test.

Poem

🐰 I hopped through the sync with a tiny hooray,
Reloaded the crumbs before they hopped away.
A token went poof, then the test held its nose,
And bunny bells jingled in code-review prose.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: stabilizing the Expo native client clear-token sync test.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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

@github-actions

Copy link
Copy Markdown
Contributor

API Changes Report

Generated by Break Check on 2026-06-26T19:17:20.991Z

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 cffa2ab.

@pkg-pr-new

pkg-pr-new Bot commented Jun 26, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/electron

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

@clerk/electron-passkeys

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

@clerk/eslint-plugin

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

@clerk/expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/hono

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: cffa2ab

@wobsoriano wobsoriano requested a review from mikepitre June 26, 2026 19:22

@mikepitre mikepitre left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@wobsoriano wobsoriano enabled auto-merge (squash) June 26, 2026 19:29
@wobsoriano wobsoriano merged commit ec709ee into main Jun 26, 2026
89 of 91 checks passed
@wobsoriano wobsoriano deleted the rob/fix-flaky-expo-test branch June 26, 2026 19:51
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