Skip to content

fix(expo-native-components): keep iOS custom pages open when the native user arrives late - #11003

Merged
wobsoriano merged 2 commits into
mainfrom
rob/mobile-734-ios-custom-page-late-user
Nov 25, 2026
Merged

wobsoriano merged 2 commits into
mainfrom
rob/mobile-734-ios-custom-page-late-user

Conversation

@wobsoriano

@wobsoriano wobsoriano commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Description

On iOS, a custom page in UserProfileView closes right after it opens if the profile mounts before native has the session. When the user then arrives, userDidChange in ClerkNativeBridge.swift reads no user to a user as an account switch and pops the page.

#10899 fixed this on Android. This ports the same rule to iOS, so only a change away from a known user resets navigation. Signing out and switching users still close the page.

Fixes MOBILE-734.

🤖 Generated with Claude under Rob's supervision.

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 Nov 25, 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 25, 2026 1:22am UTC
mosaic-docs Ready Ready Preview Nov 25, 2026 1:22am UTC
swingset Ready Ready Preview Nov 25, 2026 1:22am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The iOS profile state now preserves navigation when a user first appears after the page mounts. It invalidates navigation when a previously non-nil user ID changes or becomes nil. A new test checks that the navigation path remains and no page events occur on first user arrival. A Changesets patch entry documents the fix.

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

Severity of issue fixed: Low

Possibly related PRs

  • clerk/javascript#10899: Applies the same navigation invalidation rule to Android when a signed-in user arrives after an embedded profile page mounts.

Suggested reviewers: mikepitre

Merge Risk: Minimal · up to f825b

This fixes iOS custom profile pages closing when the user arrives after the page mounts, while sign-out and account switching still close the page. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the iOS fix in expo-native-components: custom pages in UserProfileView stay open when the native user arrives late. This matches the changeset, which changes userDidChange in ClerkNati…
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.
Description check Passed The description explains the bug (a custom page in UserProfileView closes when the profile mounts before native has the session, because userDidChange in ClerkNativeBridge.swift treats nil-to-user as …
Full details: Title check

Explanation

The title names the iOS fix in expo-native-components: custom pages in UserProfileView stay open when the native user arrives late. This matches the changeset, which changes userDidChange in ClerkNativeBridge.swift, removes hasObservedUserID, and adds a test for a user arriving after mount. The title is specific and does not use vague terms.

Full details: Description check

Explanation

The description explains the bug (a custom page in UserProfileView closes when the profile mounts before native has the session, because userDidChange in ClerkNativeBridge.swift treats nil-to-user as an account switch). It states the fix ports the Android rule so only a change away from a known user resets navigation, and that sign-out and user switching still close the page. It is directly related to the changeset, so the description check passes.

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

Warning

Linked repositories: This review skipped 6 repositories. Cross-repository analysis may be incomplete. Check linked repository access and settings.

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 5161cd2 and f825bb4.

Files selected for processing: 3

  • .changeset/ios-profile-custom-page-native-sign-in.md
  • packages/expo-native-components/ios/ClerkNativeBridge.swift
  • packages/expo-native-components/ios/Tests/ClerkUserProfileCustomPageStateTests.swift
Linked repositories identified

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

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

@changeset-bot

changeset-bot Bot commented Nov 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f825bb4

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

This PR includes changesets to release 2 packages
Name Type
@clerk/expo-native-components 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

@pkg-pr-new

pkg-pr-new Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/electron

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

@clerk/electron-passkeys

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

@clerk/eslint-plugin

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

@clerk/expo

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

@clerk/expo-biometrics

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

@clerk/expo-google-signin

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

@clerk/expo-native-components

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/hono

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

@clerk/localizations

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

@clerk/mosaic

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: f825bb4

@blacksmith-sh

blacksmith-sh Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Matches iOS custom page stays open when the native user arrives late

Late arrival nil -> user_1 kept 'billing' open on head but popped it on base; sign-out and account switch still closed it on both.

Merge-base

Late user pops page

This PR f825bb40

Late user keeps page

Proof on f825bb40 · mocked: ClerkUserProfileCustomPageState (Real class copied verbatim from each commit, compiled with Swift 6.0.3 on Linux;...) · not run: expo-native iOS app (iOS simulator and Xcode cannot run on the Linux sandbox) · Did Proof get it right? Yes · No

View full Proof report · React 👎 or comment @codesmith dismiss this proof to dismiss

@wobsoriano
wobsoriano requested a review from swolfand November 25, 2026 01:26
@github-actions

Copy link
Copy Markdown
Contributor

API Changes Report

Generated by Break Check on 2026-11-25T01:27:37.196Z

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

@wobsoriano
wobsoriano merged commit f3aa3c7 into main Nov 25, 2026
75 of 109 checks passed
@wobsoriano
wobsoriano deleted the rob/mobile-734-ios-custom-page-late-user branch November 25, 2026 17:14

This branch was successfully deployed

2 active deployments
Preview – swingset — f825bb40 Deployed Nov 25, 2026 by vercel[bot]
Preview – clerk-js-sandbox — f825bb40 Deployed Nov 25, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants