fix(android): accept a dispatched am start timeout once the app is foreground

Merged
ZE
24d ago
+134-11

Summary

am start -W stops waiting after about 10 s and prints Status: timeout. The launch keeps going, so a slow cold start failed open even though the app came up. Now tryAndroidHelperLaunch treats Status: timeout plus an Activity: line for the requested package as dispatched. It then polls the foreground until that package is up, within a 30 s deadline that starts at dispatch and matches the helper's app action budget. If the package never comes up, the open fails with reason: android-launch-not-foreground. A timeout with no Activity: line, or one that names another package, still fails right away. Nothing is resent.

2 files touched. No scope expansion. Fixes #4095.

Validation

Tested SHA 44bbf31 (base d4bcd42).

  • pnpm check:quick: passed.
  • automation-helper-app.test.ts: 8/8 passed. On base, the two new timeout+Activity tests fail.
  • pnpm check:affected --run --head 44bbf31 (exactCommit=true): format, lint, typecheck, layering, fallow and build passed. vitest-related failed: 38 provider-integration tests hit zip not found in PATH, and base fails the same 38. This host has no zip/unzip. A local pnpm test:unit failed only zip-dependent tests, and base fails those too.
  • CI at 44bbf31: Integration Tests and Coverage passed. Android Smoke failed at live-form-scenario.ts:62: the email field read ada@example instead of ada@example.test. That is the fill path, not open. It may be flaky; this is not proven.
  • Not verified on a device: I had no Android device or emulator.