Skip to content

fix(j5): the mobile rig's Metro serves one bundle, as a release build does - #904

Merged
Jacksondr5 merged 1 commit into
j5/mainfrom
j5code/rig-metro-no-lazy
Nov 2, 2026
Merged

Jacksondr5 merged 1 commit into
j5/mainfrom
j5code/rig-metro-no-lazy

Conversation

@Jacksondr5

Copy link
Copy Markdown
Owner

Problem

Dev clients on the mobile rig sometimes launch with "Could not import shared content", while the thread outbox and composer drafts fail to load at the same moment (#837). The likely cause is the dev client's lazy bundling: import("expo-file-system") is fetched from Metro as a separate chunk, and all three stores start with that import. This is inferred, not proven; #837 has the evidence.

Refs #837. It stays open until a tester has run this setting.

What changed

startMetro in scripts/j5/live-test-mobile.ts sets EXPO_NO_METRO_LAZY=1. The manifest then asks for lazy: false, so the app loads as one bundle, the way expo export:embed builds a release. Rig tests now bundle like a release build for this one setting.

Modes checked, from the code: --mobile ios and --mobile android call startMetro from one place, and --mobile phone from another, so all three get it, including Jackson's checkpoints. A Metro already running keeps its old environment until stop. Not covered: vp run dev:client by hand and test-t3-mobile's own steps, which don't use this function.

mobile-open still works: it waits for Metro to report a bundle served, and the main bundle still counts. The cost is a larger first bundle.

The rig how-to is unchanged. Its "press Retry" note stays until a tester has shown the dialog is gone.

Live testing

None by me (builders don't run devices). After this merges, the tester runs the launches listed on #837. That run decides the issue: Metro's log should show no lazy expo-file-system chunk, and no dialog should appear. If the dialog still appears, lazy chunks aren't the cause.

Checklist

  • One concern: the description has no "also"
  • Tests cover the changed behavior: no unit test. It's one environment value, and a test would only repeat it; the tester's run is the proof.
  • UI changes: none
  • Live testing: pending the tester, as above
  • Upstream-owned files: none edited (scripts/j5/ is J5's)
  • Upstream product: no change. The app and upstream's share code are untouched.
  • Surfaces: every rig mode that starts Metro, listed above
  • Docs: none yet, as above

Built by Claude Opus 5.5 in J5 Code (Claude Code harness).

🤖 Generated with Claude Code

… does

Dev clients fetch `import()` targets from Metro as lazy chunks at launch. When
one fails to load, every `import("expo-file-system")` can fail with it, which
read as "Could not import shared content" plus failed draft and outbox loads
(#837). With EXPO_NO_METRO_LAZY=1 there are no chunks to fetch, which protects
checkpoints and settles whether lazy chunks are the cause.

Refs #837

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vercel

vercel Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
j5-code Ready Ready Preview Nov 2, 2026 4:35am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 2, 2026

Copy link
Copy Markdown

Warning

Review limit reached

  • Run on-demand review

This review includes 1 billable file and costs up to $0.25.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 1 minute for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available. Your 53 included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 7a8a6e2 and dee2650.

Files selected for processing: 1
  • scripts/j5/live-test-mobile.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@github-actions github-actions Bot added the vouch:trusted Author is trusted by repo permissions or the VOUCHED list. label Nov 2, 2026
@github-actions github-actions Bot added the size:XS 0-9 effective changed lines (test files excluded in mixed PRs). label Nov 2, 2026
@Jacksondr5

Copy link
Copy Markdown
Owner Author

Source review at dee2650fae: approved, no findings.

  • iOS and Android setup call the same startMetro; phone setup calls that function too. The setting reaches every rig mode.
  • The installed Expo CLI reads EXPO_NO_METRO_LAZY from its process environment (utils/env.js) and uses its inverse for the manifest's lazy option (ManifestMiddleware.js:207). Setting it to 1 selects lazy: false.
  • metroBundles counts the main iOS Bundled / Android Bundled line, so mobile-open still observes a served bundle. No rig step depends on separate lazy chunks.
  • The change is limited to the Metro environment and its comment. An already-running Metro must be stopped and started to receive it, as the PR notes.

Validation: vp test run scripts/j5/live-test-mobile.test.ts — 25 passed; diff whitespace check clean. No device run by this reviewer. The #837 diagnosis remains inferred; the planned cold-launch runs after merge decide whether the dialog and storage warnings disappear with no lazy chunk fetched.

Reviewed by GPT-6.1 Sol in Codex (reviewer-sol), at the Captain's request for a single reviewer.

@Jacksondr5
Jacksondr5 merged commit d1d9104 into j5/main Nov 2, 2026
30 checks passed
@Jacksondr5
Jacksondr5 deleted the j5code/rig-metro-no-lazy branch November 2, 2026 04:49
Jacksondr5 added a commit that referenced this pull request Nov 8, 2026
…sing Retry (#905)

mobile-open told testers to press Retry on "Could not import shared content".
With #904 in, that dialog is unexpected on the rig and is the signal to reopen
#837, so Retry alone would clear the evidence.

Refs #837

Co-authored-by: Claude Opus 5.5 <[email protected]>

This branch was successfully deployed

1 active deployment
Preview — dee2650f Deployed Nov 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 effective changed lines (test files excluded in mixed PRs). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant