You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f4fccd0
Browse filesBrowse the repository at this point in the historyBrowse files
refactor(ios-runner): make off-main access to main-owned capture state fail the runner gates (#2911)
* refactor(ios-runner): own main-thread capture state in RunnerMainOwnedState
Target identity, accessibility health and the post-snapshot delay flag move
into one @mainactor type, so Swift 5 mode rejects a read or write of them from
the command queue instead of leaving the boundary to review (#2882).
Every main hop's work closure is @mainactor and runs through one
MainActor.assumeIsolated helper; timeoutError and onAbandoned are @sendable,
so the #2836 routing-probe shape no longer compiles. Functions that only run
on main carry @mainactor; the transport, command queue, capture plan,
watchdog and the locked completion/abandonment owner stay nonisolated.
Escaping closures carry @mainactor or @sendable: transport completions and
in-flight waiters, DispatchSource handlers, the phase-timer clock and the
unit-test hooks. The recorder's capture is @mainactor and is called only inside
the frame tick's main hop; ScreenRecorder.start takes a non-escaping bootstrap
and a @sendable frame.
Unit tests that touch the state run on the main actor, or step onto it with
MainActor.assumeIsolated where they also dispatch work off main.
* build(ios-runner): fail runner builds on actor-isolation diagnostics
Swift 5 mode reports several off-main uses of main-actor state only as
warnings, for example a RunnerMainOwnedState read inside a
DispatchQueue.async closure. build-xcuitest-apple.sh now tees the
build-for-testing log, keeps xcodebuild's exit status, and after a
successful build fails on any Swift diagnostic line, warning or error, that
contains "actor-isolated" or "loses global actor". Other warnings stay
ungated. The script says so when it reuses DerivedData, because an
incremental build prints diagnostics only for the files it recompiles.
* chore(gates): key the runner build cache on the isolation scan
The build-for-testing step now runs scripts/runner-isolation-diagnostics.ts,
so a change to the scan misses the cache and is exercised on a cold build,
like the other scripts that build runs.
* refactor(ios-runner): enter the main actor through one shared runOnMainActor
The quiescence-skip block converted a @mainactor block to XCTest's
nonisolated block parameter, which the compiler accepts without a
diagnostic. It is now a plain block that enters isolation through
runOnMainActor, as do both applyMainOwnedSnapshotState hops, so every
main-actor entry checks the thread in one internal helper.
* fix(ios-runner): capture the runner weakly after a response send
* build(ios-runner): give the isolation scan a compiled positive control
The runner gate builds compile RunnerIsolationCanary.swift with the
runner's own flags, and the scan fails unless every canary line carries
a concurrency diagnostic, so a reworded diagnostic fails the gate
instead of passing it. The scan also matches the ActorIsolatedCall and
SendableClosureCaptures groups and Sendable-capture prose. A failed scan
drops the intermediates so a rerun recompiles and rescans every file.
The npm package does not ship the canary.
* refactor(ios-runner): hold main's new gesture-policy and alert-test code to the main-owned state
performSynthesizedGesture reads accessibility health through mainOwned
and runs on the main actor with its callers; the unit tests that set the
health or resolve alerts on main carry @mainactor.
* refactor(ios-runner): name the tuple send sendResult and start test recordings through one helper
* test(gates): state where the isolation canary compiles and drop the duplicate line-count test
0 commit comments