Skip to content

fix(expo-native-components): keep custom pages open when native sign-in lands - #10899

Merged
wobsoriano merged 2 commits into
mainfrom
rob/fix-embedded-profile-custom-page-flake
Nov 18, 2026
Merged

wobsoriano merged 2 commits into
mainfrom
rob/fix-embedded-profile-custom-page-flake

Conversation

@wobsoriano

@wobsoriano wobsoriano commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Description

On Android, a custom page in UserProfileView closed right after it opened if the profile mounted before native had the session. When the user then arrived, userDidChange read null to user as an account switch and popped the page. This is the flaky embedded-profile.e2e.ts test on release runs.

Now only a change away from a known user pops the page. iOS has the same logic in ClerkNativeBridge.swift and is unchanged, since it hasn't flaked.

The recordings below use a local patch on both builds, not committed. It delays native sign-in and holds the user back from userDidChange for 2.5s, so the page opens before the user arrives every time. The before run also has the old userDidChange restored locally, which is why both runs name the same commit.

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:

🤖 Generated with Claude under Rob's supervision.

Verified on an Android emulator. Run r20261118-094048-2d51 on verify-android-1 (emulator-5560) at 716b3b58dfdc, 1 of 1 passed. Before is run r20261118-093934-76e5 at 716b3b58dfdc, 0 of 1 passed.

Before After
evidence-dfbf7212bbe8d59f-2.mp4
evidence-dfbf7212bbe8d59f-1.mp4

… mounts

The new test fails on main. ClerkUserProfileCustomPageState pops a presented custom page when the native user goes from null to a signed-in user.
…in lands

userDidChange now invalidates navigation only when a previously observed user changes. A user that arrives after the profile mounted signed out no longer pops the presented page.
@vercel

vercel Bot commented Nov 18, 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 18, 2026 5:39pm UTC
mosaic-docs Error Error Nov 18, 2026 5:39pm UTC
swingset Ready Ready Preview Nov 18, 2026 5:39pm UTC

Request Review

@changeset-bot

changeset-bot Bot commented Nov 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 716b3b5

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

@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Android custom-page state now records incoming user IDs and skips navigation invalidation when the previous ID is null or unchanged. It invalidates navigation when an existing user ID changes. Tests cover both transitions. A patch changeset describes the Android UserProfileView issue.

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

Severity of issue fixed: Low

Suggested reviewers: seanperez29, mikepitre

Merge Risk: Minimal · up to 716b3

On Android, custom pages in an embedded profile view no longer close when the native signed-in user arrives after the view mounts. Account switches still reset navigation. No merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the Android fix in ClerkUserProfileCustomPageState for keeping custom pages open when the native sign-in arrives. The changeset adds a guard in userDidChange so a user arriving from nu…
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 states the bug (Android custom page in UserProfileView closes when the profile mounts before native has the session), the cause (userDidChange treats null-to-user as an account switch)…
Full details: Title check

Explanation

The title names the Android fix in ClerkUserProfileCustomPageState for keeping custom pages open when the native sign-in arrives. The changeset adds a guard in userDidChange so a user arriving from null does not invalidate navigation, and adds tests for it. The title matches the main change. It uses the conventional commit prefix and fits the 'fix' type.

Full details: Description check

Explanation

The description states the bug (Android custom page in UserProfileView closes when the profile mounts before native has the session), the cause (userDidChange treats null-to-user as an account switch), the fix (only a change away from a known user pops the page), and the iOS scope (ClerkNativeBridge.swift unchanged). It also gives testing context and verification evidence, so it is clearly related to the changeset.

Finishing Touches

Fix failing CI checks

  • Commit to this branch
  • Create a new PR
  • 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.

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between b7927e6 and 716b3b5.

Files selected for processing: 3

  • .changeset/profile-custom-page-native-sign-in.md
  • packages/expo-native-components/android/src/main/java/expo/modules/clerk/ClerkUserProfileCustomPageState.kt
  • packages/expo-native-components/android/src/test/java/expo/modules/clerk/ClerkUserProfileCustomPageStateTest.kt
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 6 reviews per hour.

@blacksmith-sh

blacksmith-sh Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Matches Page stays open when the user arrives after mount

A user arriving after the page opened no longer pops it (it did without this PR); switching account or signing out still pops it to root.

Merge-base

Late user arrival

This PR 716b3b58

Late user arrival

All transitions

Proof on 716b3b58 · not run: integration/expo-native app (No Android SDK, emulator or Clerk Platform API key in the sandbox; the race also...) · Did Proof get it right? Yes · No

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

@pkg-pr-new

pkg-pr-new Bot commented Nov 18, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/electron

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

@clerk/electron-passkeys

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

@clerk/eslint-plugin

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

@clerk/expo

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

@clerk/expo-biometrics

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

@clerk/expo-google-signin

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

@clerk/expo-native-components

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/hono

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

@clerk/localizations

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

@clerk/mosaic

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: 716b3b5

@github-actions

Copy link
Copy Markdown
Contributor

API Changes Report

Generated by Break Check on 2026-11-18T17:41:07.745Z

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 716b3b5.

@wobsoriano
wobsoriano requested a review from a team November 18, 2026 17:48
@wobsoriano
wobsoriano merged commit ecbe3b8 into main Nov 18, 2026
73 of 75 checks passed
@wobsoriano
wobsoriano deleted the rob/fix-embedded-profile-custom-page-flake branch November 18, 2026 18:35

This branch was successfully deployed

2 active deployments
Preview – swingset — 716b3b58 Deployed Nov 18, 2026 by vercel[bot]
Preview – clerk-js-sandbox — 716b3b58 Deployed Nov 18, 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