fix(selectors): retire the stored tree after a side effect or a native read - #2869
Conversation
Size Report
Startup median (7 runs, lower is better):
|
b17286d to
eab7f34
Compare
|
Addressed the blocking finding in
|
|
Reviewed at eab7f34. The code looks correct: a side effect that does not capture, or a native read that answers without capturing, now retires the stored tree, so the next Not blocking, take or leave:
The live numbers (0/12 at this head against 8/12 on main, and 0/7 against 4/6 for the batch run) are author-reported. Smoke Tests, Repo Guards and Coverage were still running. Smoke runs the |
…e read Selector reads reuse the session's stored tree for 750 ms after its capture. Two events outdated that tree without replacing it: a wait text satisfied by the owner's native text reading after an earlier miss capture, and a mutation that captured nothing. The next get or is then reused the pre-change tree and reported Selector did not match. Every side-effect seam (expireRefFrame) and every native text reading now marks the session's current tree outdated, and the session cache tier refuses an outdated tree. The mark is keyed by the tree, so it survives the session record copies that reset the per-session runtime revision. Closes #2866
eab7f34 to
a9b3878
Compare
|
Rebased onto main at |
|
Summary
Selector reads (
get,is,find,wait) reuse the session's stored tree for up to 750 ms after it was captured. Two events outdated that tree without replacing it:wait textpoll missed natively, captured and stored the old screen, then got a nativefindTexthit.press, for example).In both cases the next read reused the pre-change tree in about 1 ms. It then returned the old value or
Selector did not match. This is the localsmoke:automation-inputfailure atget text id="automation-event-name".Fix: every side-effect seam (
expireRefFrame) and every native text read marks the session's current tree outdated. The session cache refuses an outdated tree. The mark is keyed by the tree, so it survives session-record copies. The per-sessionruntimeRevisionresets on those copies, andsession-selector-dispatch.tsmakes one right after its seam. 7 files, including CHANGELOG andselector-capture.md.Closes #2866
Validation
Tested SHA
eab7f34d.pnpm check:affected --runpasses.wait-runtime.test.ts:wait text, thenget. Fails if thefindTextmark is removed.interaction-touch-press.test.ts:is, then coordinatepress, thenget. Fails if the seam mark is removed.wait textrepro: origin/main failed 8/12; this SHA failed 0/12 (the earlier findText-only head failed 0/27).get→press→get: seam mark removed, 4/6 stale (Last input: nonein 1 ms); fix, 0/7.assertAutomationInput×10: every startup read passed. 2 runs failed later in the separate long-press/scroll bucket.