Skip to content

fix(expo): preserve mounted native auth view - #9644

Merged
seanperez29 merged 1 commit into
mainfrom
sean/expo-preserve-mounted-auth-view
Sep 3, 2026
Merged

fix(expo): preserve mounted native auth view#9644
seanperez29 merged 1 commit into
mainfrom
sean/expo-preserve-mounted-auth-view

Conversation

@seanperez29

@seanperez29 seanperez29 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Description

Prevents an already-mounted native iOS AuthView from being replaced when the Clerk SDK configuration refreshes. Replacing the hosting controller could reset the native navigation stack during post-authentication flows, causing prompts such as trusted-device enrollment to disappear before the user could respond.

Configuration notifications will still attach the native controller when it was initially unavailable. Tests cover both preserving an existing controller and attaching one after delayed configuration.

To test, render an Expo AuthView using mode="signInOrUp" and isDismissible={false}, then complete authentication with a user eligible for trusted-device enrollment. Confirm that the enrollment prompt remains visible after the authentication state synchronizes and can be completed normally.

Fix related to: https://app.plain.com/workspace/w_01GT53BQWV3DFW6ECTWZNQ1E9K/thread/th_01M0ZRA3A0JFDP0QG0P15SWPDD

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 Sep 3, 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 Sep 3, 2026 12:58am UTC
swingset Ready Ready Preview Sep 3, 2026 12:58am UTC

Request Review

@changeset-bot

changeset-bot Bot commented Sep 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 32b61d8

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

This PR includes changesets to release 1 package
Name Type
@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 Sep 3, 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: ASSERTIVE

Plan: Team

Run ID: ef8fcb72-16e5-488d-92c2-987123ffaf1a

📥 Commits

Reviewing files that changed from the base of the PR and between 5a67f6d and 32b61d8.

📒 Files selected for processing (3)
  • .changeset/calm-spoons-listen.md
  • packages/expo/ios/ClerkNativeViewHost.swift
  • packages/expo/ios/Tests/ClerkNativeViewHostTests.swift
🔗 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)

Included review availability: 9 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 10 reviews per hour.


📝 Walkthrough

Walkthrough

The Expo iOS native view host now skips configuration-driven updates when a hosted controller is already attached. The hosting coordinator exposes whether a controller is attached. Tests cover controller preservation, deferred attachment after configuration, and repeated-notification idempotence. Test utilities mount and unmount the host view and track hosted-controller creation. A patch changeset documents the @clerk/expo fix.

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

Merge Risk: ⚪ Minimal · up to 32b61

The iOS Expo AuthView now retains its mounted native controller across Clerk configuration refreshes, preventing authentication navigation and enrollment prompts from being reset while still attaching a controller when configuration becomes available. The covered behavior is ready to merge with no active current-head risk identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 2 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly and concisely describes the main change: preserving an already-mounted native Expo authentication view.
Description check ✅ Passed The description directly explains the iOS AuthView replacement bug, the configuration-refresh behavior, the expected fix, and the related tests.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 2 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI

Warning

Linked repositories: Your configuration references 7 linked repositories, but your current plan allows 5. Analyzed clerk/clerk_go, clerk/dashboard, clerk/accounts, clerk/backoffice, clerk/clerk, skipped clerk/clerk-docs, clerk/cloudflare-workers.


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

@pkg-pr-new

pkg-pr-new Bot commented Sep 3, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/electron

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

@clerk/electron-passkeys

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

@clerk/eslint-plugin

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

@clerk/expo

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

@clerk/expo-google-signin

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/hono

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: 32b61d8

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

API Changes Report

Generated by Break Check on 2026-09-03T01:00:48.438Z

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 32b61d8.

@seanperez29
seanperez29 merged commit ceb906b into main Sep 3, 2026
59 checks passed
@seanperez29
seanperez29 deleted the sean/expo-preserve-mounted-auth-view branch September 3, 2026 01:17
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