fix: improve android snapshot freshness#430
Conversation
1efc3d0 to
328a63b
Compare
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1efc3d0b1f
ℹ️ 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".
| session: SessionState, | ||
| ): Promise<void> { | ||
| if (!getActiveAndroidSnapshotFreshness(session)) return; | ||
| await params.captureSnapshotForSession( |
There was a problem hiding this comment.
Fall back to cached ref when freshness refresh fails
When Android freshness tracking is active, press/fill @ref now blocks on a pre-action snapshot refresh. That refresh can fail (for example, UIAutomator timeout or transient adb issues), and the exception aborts the interaction before the existing @ref target is attempted. This turns a freshness optimization into a hard failure path for otherwise valid interactions during unstable Android transitions.
Useful? React with 👍 / 👎.
| params.req.flags, | ||
| params.sessionStore, | ||
| params.contextFromFlags, | ||
| { interactiveOnly: true }, |
There was a problem hiding this comment.
Preserve comparable baseline after freshness ref refresh
This refresh uses interactiveOnly: true, which stores a compact snapshot in session.snapshot; after the action, freshness is re-marked from that stored snapshot. Compact/interactive snapshots are not route-comparable, so subsequent Android freshness checks lose stuck-route detection and retries. In quick @ref sequences (the exact case this change targets), stale-route recovery becomes weaker than before.
Useful? React with 👍 / 👎.
Summary
Improve Android stale snapshot recovery and bounded UIAutomator failures.
@refinteractions while freshness tracking is active.@refrefreshes best-effort, preserve comparable freshness baselines after refreshed@refactions, and avoid treating narrow interactive trees as stale sharp drops.settings animations off|onfor Android global animation scales.Touched files: 20. Scope stayed within Android snapshot/settings freshness plus docs/tests.
Validation
pnpm formatpnpm check:quickpnpm exec vitest run src/daemon/handlers/__tests__/interaction.test.tspnpm exec vitest run src/daemon/handlers/__tests__/snapshot-handler.test.ts src/daemon/handlers/__tests__/interaction.test.ts src/platforms/android/__tests__/snapshot.test.tspnpm check:unitpnpm build/Users/thymikee/Developer/RNCLI83with temporaryReactNative.Animated.loop:settings animations offapplied successfully,screenshotsucceeded, andsnapshot -ifailed after the bounded 8s UIAutomator timeout with the new targeted hint. Temporary app changes were removed andsettings animations onwas restored.