You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Mobile (Android): "Could not import shared content" on first launch #837
On a fresh Android install, launching the app with no share in progress shows "Could not import shared content". Retry clears it. Seen during the infra run (W6).
The code is upstream's (apps/mobile/src/features/sharing/incoming-share-storage.ts:35, IncomingShareProvider.tsx:274), unchanged from v0.1.3. Diagnose first: record the original exception and storage state on a fresh install. If it reproduces on upstream, offer the fix upstream (#276) rather than adding retry machinery here.
Gap row F5 in the artifact mobile-catchup/gaps/foundations.md.
— Posted by an AI agent (Claude Opus 5.5) on Jackson's behalf. Evidence is read from code on origin/j5/main8e8dcc54e1 and not yet confirmed on a device; the mobile live-test round will confirm it.
Not reproduced on a fresh Android 16 install by the live tester (2026-10-31). It stays open as seen once in W6; recheck on later installs. Reports are in the project artifacts mobile-catchup/live/*.md, and screenshots are on j5/evidence under mobile-live/. — Claude Opus 5.5 for Jackson
Closing as not reproduced. Reopen if it appears again with the exception captured.
Sightings: one, in W6 on 2026-10-31. The dialog said "Incoming share storage operation load failed for unknown", and Retry cleared it. The original exception was never logged.
Retries: not reproduced in the 2026-10-31 live round or in 3 launches on trunk 105dafde53 (test-reports/android-837/105dafde53.md). Those runs had a faster Metro than W6, so they were less cold.
Whose code: upstream's. apps/mobile/src/features/sharing/ is unchanged from our pin.
Likely cause, not proven: a dev-client lazy chunk (expo-file-system) failing to fetch or evaluate. That wouldn't affect a release build, but no release Android build has been tested.
Reopening: it reproduced, on 105dafde53, on a new Android 16 AVD with a freshly installed dev client, a new Metro and no share intent. Load was low (about 4), so it isn't host load. Retry cleared it. Report: test-reports/android-837/reproduced-105dafde53.md.
New: it isn't only share import. At the same timestamp the log shows the thread outbox failing to load and composer drafts failing to open (drafts.json). So several storage callers fail together.
The original cause still isn't logged, and Metro logs no lazy-bundle failure, so the dev-client chunk theory stays unproven. If it's a real storage failure rather than a dev-client one, a failed hydrate could matter for drafts and queued messages on release builds.
Diagnosis from the reproduction (tester's report: project artifact test-reports/android-837/reproduced-105dafde53.md). This is from code and logs; I ran no device. "Inferred" marks what isn't proven.
The shared step
The share inbox (load), the thread outbox (load) and composer drafts (open) failed at the same timestamp, 23:28:19.060. All three begin with await import("expo-file-system") inside their try, and each turns any failure into its own generic storage error.
Inferred: that import rejected. The original exception isn't in the logs, because these errors don't print cause. The evidence:
A healthy launch fetches the expo-file-system chunk once (three of three earlier launches). The failing launch fetched it twice, with the store warnings in between and no main-bundle reload. Expo caches a chunk per path and drops it only when loading rejects, so a second fetch means the first was rejected.
Metro logging no failure doesn't contradict this. Metro built the chunk successfully; the failure would be on the device, while fetching or eval-ing it. Today's logs show that class of failure on the widget chunk in the same launch: SyntaxError: 113094:21: ')' expected at end of function call, then a re-fetch. An earlier run failed at a different position (107421:40), which points to a damaged body rather than bad source.
The directory already existing before Retry fits too: the provider's catch re-reads storage immediately, and that second attempt would have created it.
Not known: why the chunk fails to load. It's in the Expo, Metro or RN dev path, and I'm not pursuing it.
What a person sees after a failed load
From code; none of this was observed on a device.
Nothing on disk is overwritten or lost.
Drafts. No dialog. Saved drafts simply aren't there. There's no timed retry: loadPromise is cleared, and the next access loads again, meaning a newly mounted composer hook (useComposerDraft and friends, effect runs once per mount) or anything awaiting waitForComposerDraftsLoaded. So opening a thread or a new task should bring them back; a composer already on screen doesn't retry.
Writes wait for a successful hydrate, so they can't clobber the file.
One small edge: on the later merge, what's in memory wins per draft, so text typed into a draft before its saved version loads would replace that saved version.
NewTaskDraftScreen has no catch on its waitForComposerDraftsLoaded().then(...). A rejected hydrate there opens no draft until its dependencies change. That might relate to L-ios-2's empty draft, but I have no evidence linking them.
Queued messages. Saved per file, so they're safe on disk. But the outbox loads once at app start. On failure, queued messages stay out of memory: not shown and not delivered. The only retry is its own alert, "Some queued messages could not be loaded", with Retry.
On Android that alert can be lost. A new dialog replaces the one showing, and the tester saw only the share dialog. The share dialog's Retry reloads only the share inbox. So inferred: on Android, saved queued messages stay invisible and unsent until the next launch.
Other load() callers are only cloud-draft paths (sign-in and sign-out).
New messages still send, because delivery starts regardless of the load result.
I haven't checked what iOS does with two alerts.
The fresh-install reproductions had nothing saved, so they showed no harm. A dev client with real data, like Jackson's phone at a checkpoint, could.
Release builds
I can't confirm this from a device: no release build has been run. From code, a release shouldn't hit this mechanism: expo export:embed bundles with lazy: false, so there's no chunk to fetch. Whether a real filesystem failure could cause the same dialog isn't ruled out until the experiment below.
The experiment
PR #904 sets EXPO_NO_METRO_LAZY=1 on the rig's Metro. After it merges, the Android tester should, on trunk with no device-side code changes:
Run node scripts/j5/setup-agent-live-test.ts --mobile android, then device_open and mobile-open. Nothing else.
In .j5code/live-test/metro.log, confirm there's noBundled … expo-file-system line, only apps/mobile/index.ts.
Record whether the dialog appears, and any [thread-outbox] or [composer-drafts] warning in adb logcat -s ReactNativeJS.
stop, then repeat from step 1 for at least 6 new-AVD, cold-Metro launches. That matches the failing conditions; pm clear against a warm Metro isn't enough.
Reading the result. Step 2 is the proof, more than the count: at the old rate (1 in 4), 6 clean launches alone aren't conclusive, but with no chunk fetched this failure can't occur.
Dialog with no chunk: the lazy-chunk lead is dead, and storage or something else needs a cause log. Reassess.
Optional, and more direct: a throwaway local build logging cause in loadIncomingShareDrafts's catch would name the exception. It can't be used on a run with this setting on, since there'd be nothing to fail.
Closing as a dev-client problem, handled on the rig by #904. Reopen if it appears without a lazy chunk, or on a release build.
Experiment on trunk 54710af291 with EXPO_NO_METRO_LAZY=1 (test-reports/android-837/no-lazy-54710af291.md): 7 new-AVD, cold-Metro launches, with zero lazy expo-file-system chunks in all 7 Metro logs. Six were fully checked: 0 share dialogs, 0 outbox warnings, 0 composer-draft warnings. The seventh was discarded because the snapshot helper failed before collection.
How strong this is: it supports the mechanism but doesn't prove it. At the earlier rate of about 1 in 4, six clean launches could happen by chance about 18% of the time. The stronger evidence is the failing launch's double chunk fetch, and that with no chunk there's nothing left to fail this way.
Not covered: no release Android build has been run. A hand-started vp run dev:client still bundles lazily, so this can still show up there. If it does, don't trust drafts or queued messages on that launch.
Another data point, not a reason to reopen: the give-back tester saw the same dialog text on upstream's dev client at dd6c05ec31, on a fresh AVD. Just before it, logcat shows Failed to install Nitro: ReactApplicationContext.javaScriptContextHolder is null!, then "Database unavailable; loading fallback preferences" (MobileDatabaseError). That app stayed blank, while J5's sightings recovered on Retry, so it may be a different failure with the same message. Cause not established.
It does show the dialog isn't J5-specific and can come from more than one cause, so check for Nitro errors if this reopens. Logs: /tmp/gb276/28-question-json/retry-logcat.txt from line 45616 on openclaw (temporary).
Activity
Jacksondr5 commentedon Oct 31, 2026
Not reproduced on a fresh Android 16 install by the live tester (2026-10-31). It stays open as seen once in W6; recheck on later installs. Reports are in the project artifacts
mobile-catchup/live/*.md, and screenshots are onj5/evidenceundermobile-live/. — Claude Opus 5.5 for JacksonJacksondr5 commentedon Nov 2, 2026
Closing as not reproduced. Reopen if it appears again with the exception captured.
105dafde53(test-reports/android-837/105dafde53.md). Those runs had a faster Metro than W6, so they were less cold.apps/mobile/src/features/sharing/is unchanged from our pin.expo-file-system) failing to fetch or evaluate. That wouldn't affect a release build, but no release Android build has been tested.No J5 change.
— Claude Opus 5.5 for Jackson
Jacksondr5 commentedon Nov 2, 2026
Reopening: it reproduced, on
105dafde53, on a new Android 16 AVD with a freshly installed dev client, a new Metro and no share intent. Load was low (about 4), so it isn't host load. Retry cleared it. Report:test-reports/android-837/reproduced-105dafde53.md.New: it isn't only share import. At the same timestamp the log shows the thread outbox failing to load and composer drafts failing to open (
drafts.json). So several storage callers fail together.The original cause still isn't logged, and Metro logs no lazy-bundle failure, so the dev-client chunk theory stays unproven. If it's a real storage failure rather than a dev-client one, a failed hydrate could matter for drafts and queued messages on release builds.
— Claude Opus 5.5 for Jackson
Jacksondr5 commentedon Nov 2, 2026
Diagnosis from the reproduction (tester's report: project artifact
test-reports/android-837/reproduced-105dafde53.md). This is from code and logs; I ran no device. "Inferred" marks what isn't proven.The shared step
The share inbox (
load), the thread outbox (load) and composer drafts (open) failed at the same timestamp, 23:28:19.060. All three begin withawait import("expo-file-system")inside theirtry, and each turns any failure into its own generic storage error.Inferred: that import rejected. The original exception isn't in the logs, because these errors don't print
cause. The evidence:expo-file-systemchunk once (three of three earlier launches). The failing launch fetched it twice, with the store warnings in between and no main-bundle reload. Expo caches a chunk per path and drops it only when loading rejects, so a second fetch means the first was rejected.eval-ing it. Today's logs show that class of failure on the widget chunk in the same launch:SyntaxError: 113094:21: ')' expected at end of function call, then a re-fetch. An earlier run failed at a different position (107421:40), which points to a damaged body rather than bad source.Not known: why the chunk fails to load. It's in the Expo, Metro or RN dev path, and I'm not pursuing it.
What a person sees after a failed load
From code; none of this was observed on a device.
Nothing on disk is overwritten or lost.
Drafts. No dialog. Saved drafts simply aren't there. There's no timed retry:
loadPromiseis cleared, and the next access loads again, meaning a newly mounted composer hook (useComposerDraftand friends, effect runs once per mount) or anything awaitingwaitForComposerDraftsLoaded. So opening a thread or a new task should bring them back; a composer already on screen doesn't retry.NewTaskDraftScreenhas nocatchon itswaitForComposerDraftsLoaded().then(...). A rejected hydrate there opens no draft until its dependencies change. That might relate to L-ios-2's empty draft, but I have no evidence linking them.Queued messages. Saved per file, so they're safe on disk. But the outbox loads once at app start. On failure, queued messages stay out of memory: not shown and not delivered. The only retry is its own alert, "Some queued messages could not be loaded", with Retry.
load()callers are only cloud-draft paths (sign-in and sign-out).The fresh-install reproductions had nothing saved, so they showed no harm. A dev client with real data, like Jackson's phone at a checkpoint, could.
Release builds
I can't confirm this from a device: no release build has been run. From code, a release shouldn't hit this mechanism:
expo export:embedbundles withlazy: false, so there's no chunk to fetch. Whether a real filesystem failure could cause the same dialog isn't ruled out until the experiment below.The experiment
PR #904 sets
EXPO_NO_METRO_LAZY=1on the rig's Metro. After it merges, the Android tester should, on trunk with no device-side code changes:node scripts/j5/setup-agent-live-test.ts --mobile android, thendevice_openandmobile-open. Nothing else..j5code/live-test/metro.log, confirm there's noBundled … expo-file-systemline, onlyapps/mobile/index.ts.[thread-outbox]or[composer-drafts]warning inadb logcat -s ReactNativeJS.stop, then repeat from step 1 for at least 6 new-AVD, cold-Metro launches. That matches the failing conditions;pm clearagainst a warm Metro isn't enough.Reading the result. Step 2 is the proof, more than the count: at the old rate (1 in 4), 6 clean launches alone aren't conclusive, but with no chunk fetched this failure can't occur.
causelog. Reassess.Optional, and more direct: a throwaway local build logging
causeinloadIncomingShareDrafts's catch would name the exception. It can't be used on a run with this setting on, since there'd be nothing to fail.— Claude Opus 5.5 for Jackson
fix(j5): the mobile rig's Metro serves one bundle, as a release build…
Jacksondr5 commentedon Nov 2, 2026
Closing as a dev-client problem, handled on the rig by #904. Reopen if it appears without a lazy chunk, or on a release build.
Experiment on trunk
54710af291withEXPO_NO_METRO_LAZY=1(test-reports/android-837/no-lazy-54710af291.md): 7 new-AVD, cold-Metro launches, with zero lazyexpo-file-systemchunks in all 7 Metro logs. Six were fully checked: 0 share dialogs, 0 outbox warnings, 0 composer-draft warnings. The seventh was discarded because the snapshot helper failed before collection.How strong this is: it supports the mechanism but doesn't prove it. At the earlier rate of about 1 in 4, six clean launches could happen by chance about 18% of the time. The stronger evidence is the failing launch's double chunk fetch, and that with no chunk there's nothing left to fail this way.
Not covered: no release Android build has been run. A hand-started
vp run dev:clientstill bundles lazily, so this can still show up there. If it does, don't trust drafts or queued messages on that launch.— Claude Opus 5.5 for Jackson
Jacksondr5 commentedon Nov 2, 2026
Another data point, not a reason to reopen: the give-back tester saw the same dialog text on upstream's dev client at
dd6c05ec31, on a fresh AVD. Just before it, logcat showsFailed to install Nitro: ReactApplicationContext.javaScriptContextHolder is null!, then "Database unavailable; loading fallback preferences" (MobileDatabaseError). That app stayed blank, while J5's sightings recovered on Retry, so it may be a different failure with the same message. Cause not established.It does show the dialog isn't J5-specific and can come from more than one cause, so check for Nitro errors if this reopens. Logs:
/tmp/gb276/28-question-json/retry-logcat.txtfrom line 45616 on openclaw (temporary).— Claude Opus 5.5 for Jackson
fix(j5): the rig asks testers to capture the share dialog before pres…