Repository navigation
fix(android): accept a dispatched am start timeout once the app is foreground - #4143
Conversation
…reground `am start -W` stops waiting after about 10 s and prints `Status: timeout` while the launch continues, so a slow cold start failed `open` even though the app came up. Treat `Status: timeout` with an `Activity:` line for the requested package as dispatched, then require that package to reach the foreground within the helper open's deadline before returning. Fixes callstack#4095
|
@zerone0x is attempting to deploy a commit to the Callstack Team on Vercel. A member of the Team first needs to authorize it. |
|
The change looks correct in code at 44bbf31, but it has no live Android run yet. The new branch in app-lifecycle.ts changes how Not blocking, take or leave: waitForAndroidPackageForeground mirrors CI shows one failure, in the Smoke Tests |
|
New head: fd815cb. Emulator run: still to do. I tried to run it on this host and could not. Shared deadline loop: done in fd815cb. Checked at fd815cb:
On |
|
Thanks for the update. At fd815cb the two foreground waits now share one helper, The changed device path is I did not run the tests or a device here. The failing Vercel check is the fork deployment authorization, not a build or test, and this diff touches only The open inline thread from the earlier review about the live run still stands. |
|
Thanks. I still have no Android emulator I can use: this host has no KVM access, and I would rather not post device output that does not come from a real run. If one of the maintainers can do the run at fd815cb, I will be glad to look into anything it shows. If not, I will post the three cases ( |
|
We ran this on an Android 15 emulator (
The code looks good, and we are accepting this. |
Summary
am start -Wstops waiting after about 10 s and printsStatus: timeout. The launch keeps going, so a slow cold start failedopeneven though the app came up. NowtryAndroidHelperLaunchtreatsStatus: timeoutplus anActivity: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'sappaction budget. If the package never comes up, the open fails withreason: android-launch-not-foreground. A timeout with noActivity: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(based4bcd42).pnpm check:quick: passed.automation-helper-app.test.ts: 8/8 passed. On base, the two new timeout+Activitytests fail.pnpm check:affected --run --head 44bbf31(exactCommit=true): format, lint, typecheck, layering, fallow and build passed.vitest-relatedfailed: 38 provider-integration tests hitzip not found in PATH, and base fails the same 38. This host has nozip/unzip. A localpnpm test:unitfailed only zip-dependent tests, and base fails those too.44bbf31: Integration Tests and Coverage passed. Android Smoke failed atlive-form-scenario.ts:62: the email field readada@exampleinstead ofada@example.test. That is the fill path, not open. It may be flaky; this is not proven.