Repository navigation
refactor(apple): give the foreground probe one result shape - #4267
Conversation
- SystemSurfaceForegroundProbe always returns { foreground, sessionId? }, so the
snapshot route drops its three narrowings.
- Test fakes without a runner session answer 'unknown', as the real probe does.
- The native wedge test holds a read after the admitted one and checks it at a
time far past the old abandon stamp, so it fails if the stamp is not cleared.
- The lease handler uses errorMessage() for the teardown diagnostic.
Follow-up to #4256 and #4257.
Size Report
Startup median (7 runs, lower is better):
|
There was a problem hiding this comment.
All reported issues were addressed across 7 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Apex SentinelVerdict: No findings. 2 findings below Reviewed with this repository's own Sentinel configuration ( Reply under an inline comment with |
|
At ae570e9 the probe now returns one Not blocking, and you can take or leave these: the PR also carries the lease.ts cleanup for #4257 and a Swift wedge assertion for #4256, which do not touch the foreground probe; the body does not give the tested SHA or the The open thread (#4267 (comment)) does not apply: the in-flight assertion is on purpose, because the second read is still inside its 1000 ms budget and the test targets the stale AbandonedAt from the first read, which RunnerSnapshotBridge.m clears at lines 225 and 239. It can be resolved. |
Export SystemSurfaceForegroundReading and use it in the probe signature and both route sites. The native wedge test block now says it pins the stale abandon stamp, and its expectation names the abandonment it waits for. Follow-up to #4267.
This PR applies the optional review items from #4256 and #4257 (#4256 (comment), #4257 (comment)). It does not change behavior.
SystemSurfaceForegroundProbenow always returns{ foreground, sessionId? }, so the three narrowings insnapshot-route.tsare gone. Only a channel that passessessionChangedswaps circuits, and a runner-session refusal still disables the bridge only for a circuit that names its session.'unknown', as the real probe does. Because'unknown'sends surface hosts to the bridge read, the fake runner refuses that check only when a test setsrefuseSurfaceHostCheck.bridge-read-in-flight.lease.tsuses the existingerrorMessage(error)helper.The #4257 description is also corrected: 14 files, and the check receipt for its merged head.
Native evidence: The runner was built with
AGENT_DEVICE_XCUITEST_INCLUDE_UNIT_TESTS=1(Xcode 26.2) and run withxcodebuild test-without-building -only-testing:AgentDeviceRunnerUITests/RunnerTests/testAbandonedReadBecomesWedgedUntilItReturnson a dedicated iOS 26.2 Simulator. It executed 1 test with 0 failures. With bothRunnerSnapshotBridgeAbandonedAt = 0resets removed, the same test fails at the newbridge-read-in-flightassertion (line 100).TS:
packages/platform-appleand the lease handler tests pass (1581 tests).Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Validation: tested at ae570e9.
pnpm check:affected --run --head ae570e9d06passed with exactCommit=true (format, lint, typecheck, layering, fallow, native-dupes, build, vitest-related, unit, xctest-selection, packaged-runner-swift).