Skip to content

fix(mobile): declare iOS and Android platforms in the Expo config - #6605

Merged
iscekic merged 1 commit into
mainfrom
kwf/explorer-the-app-logged-a-javascript-error-while-a-user-d-9fee6-b6bc
Sep 23, 2026
Merged

iscekic merged 1 commit into
mainfrom
kwf/explorer-the-app-logged-a-javascript-error-while-a-user-d-9fee6-b6bc

Conversation

@iscekic

@iscekic iscekic commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Changelog for users

  • A browser request to the mobile dev server now receives the manifest response instead of an app web page.
  • The app console no longer logs a react-native-web module-resolution error while a user drives the app.

Changelog for maintainers

  • The Expo config declares platforms: ['ios', 'android'], so platform detection cannot add web even when the workspace resolves react-dom.
  • A config assertion fails when the declared platforms are not exactly iOS and Android; it runs with the mobile config check.
  • Review the declared platforms first; the assertion only guards that value.
  • The dev server manifest now reports only ios and android in its platform list.
  • No native build, runtime code, or dependency changes.

E2E proof — log excerpts

[e1] Explorer finding: the app logged a JavaScript error while a user drove it — e2e-mobile-app/e1-profile.png

[e1] Explorer finding: the app logged a JavaScript error while a user drove it -> pass :: android/emulator-5554: drove Home->Agents->Profile->Home->Agents; dev/logs/mobile.log kept 'rn_web_matches_total=0', 'unable_to_resolve_total=0', 'web_bundling_failed_total=0' while carrying the drive's own app-console lines (' LOG [screen-tracking] (app)/(tabs)/(2_agents)'); the browser-style root request returned 'content_type=[text/plain] http=[200] bytes=[180265]' (manifest, not text/html) and the manifest read 'extra.expoClient.platforms = ["ios", "android"] contains_web = False'; screenshots e1-home.png/e1-agents.png/e1-profile.png captured for the visual reviewer; no state fixture was named by the pack for the repro's credits/reviews/light-mode context and it does not bear on a dev-se
/home/igor_kilocode_ai/.local/share/kwf/sections/kwf-fix-proof-fb58eb1-bb3e/e2e-mobile-app/e1-mobile-log.log
content_type=[text/plain] http=[200] bytes=[180265]
starts_with_doctype_html=0
-- dev/logs/mobile.log around the drive --
lines_before=251
lines_before_browser_probe=254
lines_after=254
lines_final=255
rn_web_matches_total=0
unable_to_resolve_total=0
web_bundling_failed_total=0
new_lines_252_plus (app console lines the drive added; proof the channel is live):
 LOG  [screen-tracking] (app)/(tabs)/(2_agents)
 LOG  [screen-tracking] (app)/(tabs)/(3_profile)
 LOG  [screen-tracking] (app)/(tabs)/(0_home)
-- manifest the dev server advertises (android header) --
request: curl -H 'expo-platform: android' -H 'accept: application/expo+json,application/json' -o e1-manifest-android.json http://localhost:9681/
content_type=[application/expo+json] http=[200] bytes=[180269]
extra.expoClient.platforms = ["ios", "android"] contains_web = False
-- verdict of this scenario --
Expected: the app logs no JavaScript error while a user uses it.
Observed: dev/logs/mobile.log has 0 occurrences of react-native-web, 0 of "Unable to resolve" and 0 of
"Web Bundling failed" across the whole drive, while the same log carried the app console lines the drive
produced; and the browser request that used to trigger web bundling now returns the manifest (text/plain),
whose platform list omits web.
/home/igor_kilocode_ai/.local/share/kwf/sections/kwf-fix-proof-fb58eb1-bb3e/e2e-mobile-app/mobile.log
 ✓  mobile-mounted  src/components/agents/session-list-screen.pull-failure.mounted.test.tsx (4 tests) 18688ms
     ✓ keeps rows, shows Updating in flight, and the inline failure with Retry (socket up)  1180ms
     ✓ keeps the same unhappy state when the API outage also dropped the socket  1109ms
     ✓ retires the pull failure when a later app-foreground refresh lands  1112ms
     ✓ hands a confirmed-offline pull to the inline failure with Retry  15284ms
 ✓  mobile-pure  src/lib/auth/auth-context.lifecycle.test.tsx (53 tests) 22507ms
     ✓ orders capture, cleanup, flush, clearTelemetryDecision, then Sentry.setUser  1385ms
     ✓ a restore-failure bootstrap never wipes the search index  1805ms
     ✓ repro: a rejected startup credential read keeps the person signed in  312ms
     ✓ reports a retryable restore failure when every retry fails, without signing out  1861ms
     ✓ restores the session when retryRestore runs after the storage recovers  1817ms
     ✓ a failed retry settles back onto the restore error surface  3558ms
     ✓ sends the person to login when the retry finds no stored session  1820ms
     ✓ does not resurrect the restore error surface when signOut lands mid-retry  3580ms
     ✓ clears the restore failure when signOut is used as the escape hatch  1804ms
 Test Files  205 passed (205)
      Tests  4237 passed (4237)
   Start at  04:40:45
   Duration  31.25s (transform 11.29s, setup 5.71s, import 84.99s, tests 129.17s, environment 38ms)
$ pnpm -w exec oxlint --config apps/mobile/.oxlintrc.i18n.json apps/mobile/src packages/app-shared/src && node ../../tools/i18n/check-catalogs.mjs
Found 0 warnings and 0 errors.
Finished in 1.1s on 1332 files with 94 rules using 16 threads.
check-catalogs: 87 languages, every catalog matches en.json

Follow-ups (not changed here)

  • not proved live: On the restarted dev server, curl -sS -H 'expo-platform: android' -H 'accept: application/expo+json,application/json' http://localhost:10481/ and read extra.expoClient.platforms: it must be exactly ["ios","android"] (no web). (no capture cited it)
  • not proved live: With the mobile dev server restarted from this worktree (dev runner owns Metro), request its root exactly as a browser does: curl -sS -o /dev/null -w '%{content_type}' -A 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36' http://localhost:10481/ -- the content type must NOT be text/html (it is the manifest response) and dev/logs/mobile.log must gain no new Web Bundling failed / react-native-web line. (no capture cited it)

Open findings (not fixed here)

  • not proved live: agents-empty.png is no longer on the host that took it, so no publish can carry it
  • not proved live: agents-list.png is no longer on the host that took it, so no publish can carry it
  • not proved live: agents-running.png is no longer on the host that took it, so no publish can carry it
  • not proved live: codereviewer-recent.png is no longer on the host that took it, so no publish can carry it
  • the '## E2E proof' section shows no screenshot, and this change has a visible surface

Explorer finding: the app logged a JavaScript error while a user drove it

The user-agent explorer found this while using the app like a user.
One finding per item; the explorer never edits product code.

Flow: freestyle
Found on revision: fb5e67d

Repro:
1. set this state first: credits 20; reviews 3; the device in light mode
2. open the app on emulator-5554
3. reach the screen named mobile.log
4. the capture shows the defect named below

Observed: the app console logged: mobile.log: Unable to resolve "react-native-web/dist/exports/Platform" from "apps/mobile/index.js"
Expected: the app logs no JavaScript error while a user uses it

Evidence (from the device run):
- ~/.local/share/kwf/findings/explorer-the-app-logged-a-javascript-error-while-a-user-d-9fee644f/agents-empty.png
- ~/.local/share/kwf/findings/explorer-the-app-logged-a-javascript-error-while-a-user-d-9fee644f/agents-list.png
- ~/.local/share/kwf/findings/explorer-the-app-logged-a-javascript-error-while-a-user-d-9fee644f/agents-running.png
- ~/.local/share/kwf/findings/explorer-the-app-logged-a-javascript-error-while-a-user-d-9fee644f/codereviewer-recent.png
@iscekic
iscekic marked this pull request as draft September 23, 2026 01:58
@kilo-code-bot

kilo-code-bot Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Reviewed the two changed files (apps/mobile/app.config.ts, apps/mobile/scripts/assert-expo-config.mjs). The new top-level platforms: ['ios', 'android'] matches the documented iOS/Android-only invariant in apps/mobile/AGENTS.md, and the added assertion correctly requires the declared platform set to equal exactly {ios, android} (length check plus subset check rules out extra platforms). No bugs, security problems, or runtime issues found in the changed lines.

Files Reviewed (2 files)
  • apps/mobile/app.config.ts
  • apps/mobile/scripts/assert-expo-config.mjs

Reviewed by deepseek-v4.1-flash · Input: 0 · Output: 0 · Cached: 0

Review guidance: REVIEW.md from base branch main

@iscekic

iscekic commented Sep 23, 2026

Copy link
Copy Markdown
Collaborator Author

bot: Rejected, no code change (kwf kwf-fix-platform-b42e).

Why: (already implemented, verified live: no change needed: The finding quotes a code comment; the change adds one platforms declaration and its assertion, both identical on iOS and Android, so there is no platform fork to remove. Refuted finding. The quoted + // Unable to resolve "react-native-web/dist/exports/AppRegistry" into the li

@iscekic
iscekic marked this pull request as ready for review September 23, 2026 03:39
@iscekic

iscekic commented Sep 23, 2026

Copy link
Copy Markdown
Collaborator Author

This description names a scenario the proof did not capture:

  • not proved live: On the restarted dev server, curl -sS -H 'expo-platform: android' -H 'accept: application/expo+json,application/json' http://localhost:10481/ and read extra.expoClient.platforms: it must be exactly ["ios","android"] (no web). (no capture cited it)

A repeated proof run rebuilds the same evidence, so no proof run is dispatched for a named gap. Merging with this gap open is your decision.

@iscekic
iscekic requested a review from eshurakov September 23, 2026 04:57
@iscekic iscekic added the human-ready The PR is ready for human review. label Sep 23, 2026
@iscekic
iscekic requested a review from pandemicsyn September 23, 2026 04:57
@iscekic iscekic self-assigned this Sep 23, 2026
@iscekic
iscekic merged commit 8a4dc6d into main Sep 23, 2026
29 checks passed
@iscekic
iscekic deleted the kwf/explorer-the-app-logged-a-javascript-error-while-a-user-d-9fee6-b6bc branch September 23, 2026 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

human-ready The PR is ready for human review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants