fix: cache Android snapshot helper installs#470
Conversation
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7ebb5c8fac
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| installCacheKey && | ||
| installPolicy !== 'always' && | ||
| installedSnapshotHelpers.has(installCacheKey) | ||
| ) { |
There was a problem hiding this comment.
Revalidate cached helper install before skipping probe
The new fast-path returns reason: 'current' solely from the in-memory cache, so a reused device ID (for example after emulator restart) or an external uninstall can leave a stale entry that suppresses cmd package list and reinstall checks. In that case this call reports the helper as current even though it is absent, and snapshotAndroid will drop to the stock backend on that capture instead of using the helper path. Consider validating cache entries on reconnect/session boundaries or retrying install once before fallback when helper invocation fails.
Useful? React with 👍 / 👎.
7ebb5c8 to
3ddb5bc
Compare
3ddb5bc to
9b518f1
Compare
Summary
Cache successful Android snapshot helper install checks per device/helper version so repeated helper-backed snapshots skip the package version probe.
Add a release-mode Android APK helper smoke that packages the helper before emulator startup, installs a generated release app, captures via the helper backend, and runs inside the existing Android emulator CI step.
Touched files: 7. Scope stayed within the Android snapshot helper path plus Android CI smoke coverage. Docs/skills were not updated because the CLI/API behavior is unchanged; this is an internal performance/reliability improvement and CI coverage addition.
Closes #455. Secondary-display investigation moved to #471. Toast capture/buffering is intentionally deferred until a real missed-toast workflow needs transient UI event support.
Validation
pnpm exec vitest run src/platforms/android/__tests__/snapshot-helper.test.ts src/platforms/android/__tests__/snapshot.test.tspnpm formatpnpm check:quickpnpm check:toolingpnpm package:android-snapshot-helper:npmsh -n test/scripts/android-snapshot-helper-release-smoke.shsh ./test/scripts/android-snapshot-helper-release-smoke.shpnpm exec vitest run --maxWorkers=4 && pnpm test:smokeKnown note: an unbounded
pnpm check:unitrerun was killed locally by the OS during Vitest; the same unit/smoke bundle passed earlier, and the final bounded Vitest run plus smoke tests passed.