Skip to content

ci(ios): embed the JS bundle for Detox instead of running Metro - #753

Merged
gre merged 2 commits into
masterfrom
fix/ci-detox-embedded-bundle
Oct 29, 2026
Merged

gre merged 2 commits into
masterfrom
fix/ci-detox-embedded-bundle

Conversation

@gre

@gre gre commented Oct 29, 2026

Copy link
Copy Markdown
Owner

master's CI is red after #748/#752: iOS Detox fails on the very first app launch. The app starts, but the home screen never appears, even after 240 s. The next 4 launches work in about 30 s each.

Cause: the uploaded metro.log shows 4 bundle requests for 5 launches: the first launch never asked Metro for its bundle. A Debug app only uses Metro if RCTBundleURLProvider's /status check (6 s timeout, isPackagerRunning) passes. Otherwise it falls back to main.jsbundle, which a Debug build doesn't contain, so it has no JS. On the first launch on a freshly booted simulator, that check fails. This is the intermittent first-launch timeout seen on #744, #746, #748, #749 and #752 (#752's prefetch-URL fix wasn't the cause).

Fix: build with FORCE_BUNDLING=1, so react-native-xcode.sh embeds the dev bundle (same JS, __DEV__), and drop Metro from the job. With nothing listening on :8081, the check fails immediately and every launch loads the embedded bundle, deterministically. Bonus: Metro's workers no longer compete with the build for CPU. Local development is unchanged (Metro as before).

🤖 Generated with Claude Code

gre and others added 2 commits October 29, 2026 04:01
master's Detox failed on the first app launch: the app started but the
home screen never showed within 240 s, while the 4 later launches worked.
Metro served 4 bundle requests for 5 launches: the first launch never
asked for one. A Debug app only uses Metro if RCTBundleURLProvider's
/status check (6 s timeout) passes, and on the first launch on a freshly
booted simulator it didn't, so the app fell back to a main.jsbundle that
Debug builds don't contain. This is the first-launch timeout seen across
#744/#746/#748/#749/#752.

Build with FORCE_BUNDLING=1 (react-native-xcode.sh then embeds the dev
bundle) and drop Metro: with nothing on :8081 the check fails at once and
every launch loads the embedded bundle. It also removes Metro's workers
from the build's CPU.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Image screen's JPEG capture differs from the reference by 0.112% of
pixels (threshold 0.1%), scattered compression noise in the photo's
textured areas: the asset now loads from the app bundle instead of over
HTTP from Metro. From this branch's CI run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gre
gre marked this pull request as ready for review October 29, 2026 07:17
Copilot AI balanced review requested due to automatic review settings October 29, 2026 07:17
@gre
gre merged commit c67fc21 into master Oct 29, 2026
14 checks passed

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants