Skip to content

Commit eabe119

Browse files
authored
fix(ios-runner): keep snapshot-plan target state on main and bound the query sweep by its slice (callstack#2836)
* fix(ios): take snapshot target identity on main and hop plan state writes The capture plan runs on the command queue but read currentBundleId, currentAppProcessIdentifier and the penalty warm-up exemption, and wrote runnerAccessibilityHealth and invalidated the cached target directly. Snapshot preparation now takes a SnapshotCaptureTarget on main (app, bundle id, pid, consumed warm-up exemption) and the plan, the modal probe penalty, the XCTest penalty recorder and the private AX tier read only that copy. Health writes and the fail-closed invalidation go through applyMainOwnedSnapshotState, the abandoned-work-guarded main hop that invalidateCachedTargetAfterSnapshotFailure now also uses. Fixes callstack#2781 * fix(ios): bound the query sweep by its tier slice deadline A non-interactive query sweep used Date.distantFuture as its own deadline, so only the up-to-20 s plan deadline bounded it while the caller abandoned the tier after its 1 s slice. XCTest queries cannot be cancelled, so the sweep kept the main thread busy and later commands got RUNNER_BUSY. The caller now derives one slice deadline (querySweepSliceDeadline) for both its wait and the sweep, for interactive and non-interactive requests alike. Neither the element queries nor the per-element reads start with less than flatInteractiveQueryBudget left before that deadline (querySweepCanStartQuery). Fixes callstack#2783 * fix(ios): spend the penalty warm-up exemption only in a capture plan that runs Taking the snapshot target on main consumed the exemption during command preparation, so a snapshot answered by the blocking system-modal probe, or an abandoned preparation that ran late, spent it without running a plan. The exemption now lives in a lock-owned type that lifecycle code arms on main and runSnapshotCapturePlan consumes at its start. * test(ios): pin the non-interactive query sweep to its tier slice through the plan Swizzles XCUIElementQuery.allElementsBoundByIndex with a slow query and runs a non-interactive [.querySweep] plan with a 20 s plan deadline. The sweep must not be abandoned, and no query may start after the plan answers, so passing the plan deadline to the sweep in either loop turns it red. * test(ios): pin the query-sweep tier timeout and the tap routing identity to main Two regressions callstack#2781 still leaves open, both red on this head: A query sweep that stops at its own slice deadline is a tier timeout, but the plan classified its payload by node count, so a partial sweep that beat the sparse threshold armed no XCTest-channel penalty and no later capture of the same screen was deferred. The coordinate tap's system-modal routing probe armed its penalty with currentBundleId read on the command queue, while main owned that state and could still be clearing or rebinding it. * fix(ios): count a query sweep that ends on its slice deadline as a tier timeout The sweep tier stopped starting queries at its slice deadline, but the plan classified only what it collected. sparsePayloadReason accepts anything above the sparse node threshold, so a partial flat sweep became a `recovered` capture: no XCTest-channel penalty was armed, private AX never ran, and every later capture of that screen paid for the full sweep again. `runFlatInteractiveQueries` now returns a typed `SnapshotTierOutcome`, the sweep tier carries it into the attempt, and the plan rejects a `.deadlineExhausted` tier through `snapshotTierRejectionReason` — keeping its payload only as the fallback, arming the penalty through the existing tier timeout reason, and letting the next backend answer. * fix(ios): take the system-modal probe's target identity on main The coordinate tap resolved its system-modal routing on the command queue and armed an abandoned probe's penalty with `currentBundleId` read there, while `applyMainOwnedSnapshotState` and the lifecycle code write that identity through `DispatchQueue.main.async`. A tap could penalize a target main was still clearing or rebinding. The probe now takes a `SnapshotProbePenaltyTarget`: a capture hands over the identity it already took on main, and the tap route hands over nothing and lets the probe's own main-side block capture the identity main holds once its work starts. No off-main path reads target identity any more. * test(ios): place this PR's runner tests in main's split UnitTests files main (callstack#2854, callstack#2855) moved the runner's inline unit tests into UnitTests/ and split RunnerTests+CommandExecution.swift along command families. Rebase conflicts dropped this PR's edits from the inline blocks the rebase kept on main; relocate them into the file main now owns for each family: - RunnerTests+SnapshotTests.swift: the query-sweep slice-deadline and fail-closed-invalidation tests, and the bounded-modal-probe helper now takes a SnapshotCaptureTarget. - RunnerTests+SnapshotCapturePlanTests.swift: the tier-timeout rejection pair and the private-AX depth helper now builds a SnapshotCaptureTarget. - RunnerTests+SnapshotTimingTests.swift: the deadline-exhausted tier penalty test.
1 parent fd8277e commit eabe119

20 files changed

Lines changed: 1048 additions & 148 deletions

‎.github/workflows/ios.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,10 @@ jobs:
256256
-only-testing:AgentDeviceRunnerUITests/RunnerTests/testActionNamesAreCappedPerElementAndReported \
257257
-only-testing:AgentDeviceRunnerUITests/RunnerTests/testHungCustomActionReadIsContainedAndRecovers \
258258
-only-testing:AgentDeviceRunnerUITests/RunnerTests/testAbandonedTreeCaptureSkipsQuerySweepAndHonorsWarmupExemption \
259+
-only-testing:AgentDeviceRunnerUITests/RunnerTests/testNonInteractiveQuerySweepStopsAtTheSliceItsCallerWaitsFor \
260+
-only-testing:AgentDeviceRunnerUITests/RunnerTests/testQuerySweepThatEndsOnItsSliceDeadlinePenalizesChannelAndReachesPrivateAX \
261+
-only-testing:AgentDeviceRunnerUITests/RunnerTests/testCoordinateTapRoutingPenalizesTheIdentityMainSettledOnWhileTheWriteWasPending \
262+
-only-testing:AgentDeviceRunnerUITests/RunnerTests/testBlockingModalSnapshotLeavesWarmupExemptionForTheFirstCapturePlan \
259263
-only-testing:AgentDeviceRunnerUITests/RunnerTests/testPrivateAXPinnedRegularDepthReachesAcquisitionAndPresentation 2>&1 | tee /tmp/agent-device-runner-regressions.log
260264
node --input-type=module -e '
261265
import { readFileSync } from "node:fs";

‎apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+AXSnapshotFallback.swift‎

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,16 @@ extension RunnerTests {
110110
/// remembered depth deliberately does NOT refresh the TTL, so expiry re-probes the full
111111
/// requested depth once per window instead of capping this screen class forever.
112112
func recordPrivateAXAcceptedDepth(
113+
bundleId: String?,
114+
processIdentifier: Int?,
113115
exactDepthRequested: Bool,
114116
effectiveDepth: Int,
115117
attemptDepths: [Int]
116118
) {
117119
guard !exactDepthRequested, effectiveDepth != attemptDepths.first else { return }
118120
rememberPrivateAXAcceptedDepth(
119-
bundleId: currentBundleId,
120-
processIdentifier: currentAppProcessIdentifier,
121+
bundleId: bundleId,
122+
processIdentifier: processIdentifier,
121123
depth: effectiveDepth
122124
)
123125
}
@@ -160,11 +162,12 @@ extension RunnerTests {
160162
}
161163

162164
func privateAXSnapshotAcquisition(
163-
app: XCUIApplication,
165+
target: SnapshotCaptureTarget,
164166
hint: CaptureHint,
165167
deadline: Date = .distantFuture
166168
) -> SnapshotAcquisition? {
167169
#if os(iOS) && targetEnvironment(simulator)
170+
let app = target.app
168171
let requestedDepth = hint.rawTraversalDepth ?? 64
169172
// An explicit --depth request is honored as asked: no accepted-depth
170173
// memory, no frontier extension past it.
@@ -173,8 +176,8 @@ extension RunnerTests {
173176
exactDepthRequested
174177
? nil
175178
: rememberedPrivateAXAcceptedDepth(
176-
bundleId: currentBundleId,
177-
processIdentifier: currentAppProcessIdentifier
179+
bundleId: target.bundleId,
180+
processIdentifier: target.processIdentifier
178181
)
179182
let attemptDepths = Self.privateAXAttemptDepths(
180183
requestedDepth: requestedDepth,
@@ -202,6 +205,8 @@ extension RunnerTests {
202205
return nil
203206
}
204207
recordPrivateAXAcceptedDepth(
208+
bundleId: target.bundleId,
209+
processIdentifier: target.processIdentifier,
205210
exactDepthRequested: exactDepthRequested,
206211
effectiveDepth: effectiveDepth,
207212
attemptDepths: attemptDepths
@@ -212,7 +217,11 @@ extension RunnerTests {
212217
}
213218

214219
let rootFrame = privateAXRect(root["frame"])
215-
let geometry = privateAXSnapshotGeometry(app: app, rootFrame: rootFrame)
220+
let geometry = privateAXSnapshotGeometry(
221+
app: app,
222+
bundleId: target.bundleId,
223+
rootFrame: rootFrame
224+
)
216225
let viewport = geometry.viewport
217226
let nodes = privateAXAcquisition(
218227
rawRoot: root,
@@ -262,8 +271,8 @@ extension RunnerTests {
262271
/// grinding on this screen class. Under penalty it reliably burns its full timeout and
263272
/// falls back anyway (~1s added to every private AX capture on the Bluesky bench feed),
264273
/// so honor the penalty here the same way capture plans do.
265-
func shouldReadPrivateAXViewportViaXCTest() -> Bool {
266-
!hasAbandonedMainThreadWork() && !isSnapshotXCTestChannelPenalized(bundleId: currentBundleId)
274+
func shouldReadPrivateAXViewportViaXCTest(bundleId: String?) -> Bool {
275+
!hasAbandonedMainThreadWork() && !isSnapshotXCTestChannelPenalized(bundleId: bundleId)
267276
}
268277

269278
/// The geometry this tier may anchor a rotation on. The bridge's own root frame is one more
@@ -272,10 +281,11 @@ extension RunnerTests {
272281
/// consumers already treat as geometry they cannot measure (#2612).
273282
private func privateAXSnapshotGeometry(
274283
app: XCUIApplication,
284+
bundleId: String?,
275285
rootFrame: CGRect
276286
) -> (viewport: CGRect, interfaceOrientation: Int) {
277287
let fallback = rootFrame.isEmpty ? CGRect.infinite : rootFrame
278-
guard shouldReadPrivateAXViewportViaXCTest() else {
288+
guard shouldReadPrivateAXViewportViaXCTest(bundleId: bundleId) else {
279289
return (fallback, RunnerInterfaceOrientation.unknown)
280290
}
281291
do {

‎apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandDispatch.swift‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,8 +579,13 @@ extension RunnerTests {
579579
}
580580
#endif
581581
let probeDeadline = Date().addingTimeInterval(systemModalProbeBudget)
582+
// Routing runs on the command queue, so this hands the probe a target rather than a bundle id it
583+
// read across the main boundary: the penalty an abandoned probe arms carries the identity main
584+
// holds once the probe starts, not one whose write was still queued behind the block that
585+
// occupied main (#2781).
582586
return boundedBlockingSystemAlertSnapshot(
583-
deadline: probeDeadline
587+
deadline: probeDeadline,
588+
penaltyTarget: .mainOwnedTarget
584589
) != nil
585590
#else
586591
return false

‎apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Lifecycle.swift‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ extension RunnerTests {
202202
/// markers. Every site that binds, rebinds, or drops the target runs this.
203203
func resetTargetBoundState() {
204204
clearRememberedTextEntryTap()
205-
snapshotXCTestPenaltyWarmupExemptionPending = false
205+
snapshotXCTestPenaltyWarmupExemption.isPending = false
206206
lastLoggedFastAppGuardLine = nil
207207
lastLoggedGesturePolicyLines.removeAll()
208208
}
@@ -247,7 +247,7 @@ extension RunnerTests {
247247
resetTargetBoundState()
248248
clearSnapshotXCTestChannelPenalty(reason: "target_process_changed")
249249
clearPrivateAXAcceptedDepth(reason: "target_process_changed")
250-
snapshotXCTestPenaltyWarmupExemptionPending = true
250+
snapshotXCTestPenaltyWarmupExemption.isPending = true
251251
beginFirstInteractionStabilization()
252252
}
253253

‎apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Snapshot.swift‎

Lines changed: 69 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,20 @@ extension RunnerTests {
132132
]
133133

134134
static let flatInteractiveFallbackBudget: TimeInterval = 1.0
135+
/// The least slice time a sweep query may start with. XCTest cannot cancel a query, so one that
136+
/// starts later outlives the slice its caller waits for and holds the main thread (#2783).
137+
static let flatInteractiveQueryBudget: TimeInterval = 0.1
138+
139+
/// The deadline the query-sweep tier's caller waits for: one slice, clamped to the plan deadline.
140+
/// Interactive and non-interactive requests share it, since the caller discards a later result.
141+
static func querySweepSliceDeadline(startedAt: Date, planDeadline: Date) -> Date {
142+
min(startedAt.addingTimeInterval(flatInteractiveFallbackBudget), planDeadline)
143+
}
144+
145+
/// Whether a sweep query started at `now` can still finish before the slice `deadline`.
146+
static func querySweepCanStartQuery(deadline: Date, now: Date) -> Bool {
147+
deadline.timeIntervalSince(now) >= flatInteractiveQueryBudget
148+
}
135149

136150
/// What one capture may spend reading the keyboard band before it gives up on the fact and lets the
137151
/// tap guard fall back to the tree rule. The scroll path pays this query per gesture and stays well
@@ -145,14 +159,17 @@ extension RunnerTests {
145159
// `boundedBlockingSystemAlertSnapshot`'s probe closure (see `systemModalProbeOverrideForTesting`
146160
// in RunnerTests.swift), so reverting this entry point to bypass the bounded probe fails the
147161
// regression test.
148-
func snapshotFast(app: XCUIApplication, options: PresentationOptions) throws -> DataPayload {
162+
func snapshotFast(target: SnapshotCaptureTarget, options: PresentationOptions) throws -> DataPayload {
149163
let deadline = Date().addingTimeInterval(Self.snapshotPlanBudget)
150-
if let blocking = boundedBlockingSystemAlertSnapshot(deadline: deadline) {
164+
if let blocking = boundedBlockingSystemAlertSnapshot(
165+
deadline: deadline,
166+
penaltyTarget: .prepared(bundleId: target.bundleId)
167+
) {
151168
return blocking
152169
}
153170
return try runSnapshotCapturePlan(
154171
Self.regularVisiblePlan,
155-
app: app,
172+
target: target,
156173
options: options,
157174
terminal: .sparseWithFatalOnAXFailure,
158175
deadline: deadline
@@ -267,14 +284,17 @@ extension RunnerTests {
267284
}
268285

269286
// See `snapshotFast` above: the single production entry point, no unit-test overload.
270-
func snapshotRaw(app: XCUIApplication, options: PresentationOptions) throws -> DataPayload {
287+
func snapshotRaw(target: SnapshotCaptureTarget, options: PresentationOptions) throws -> DataPayload {
271288
let deadline = Date().addingTimeInterval(Self.snapshotPlanBudget)
272-
if let blocking = boundedBlockingSystemAlertSnapshot(deadline: deadline) {
289+
if let blocking = boundedBlockingSystemAlertSnapshot(
290+
deadline: deadline,
291+
penaltyTarget: .prepared(bundleId: target.bundleId)
292+
) {
273293
return blocking
274294
}
275295
return try runSnapshotCapturePlan(
276296
Self.rawDiagnosticPlan,
277-
app: app,
297+
target: target,
278298
options: options,
279299
terminal: .throwOnAXFailure,
280300
deadline: deadline
@@ -283,8 +303,15 @@ extension RunnerTests {
283303

284304
/// Runs the pre-plan SpringBoard system-modal probe as a bounded capture tier sharing the plan
285305
/// deadline, so a slow alert enumeration cannot bypass the snapshot timeout and stall (#1244).
286-
func boundedBlockingSystemAlertSnapshot(deadline: Date) -> DataPayload? {
287-
boundedBlockingSystemAlertSnapshotBody(deadline: deadline) { probeDeadline in
306+
/// An abandoned probe penalizes the XCTest channel for `penaltyTarget`.
307+
func boundedBlockingSystemAlertSnapshot(
308+
deadline: Date,
309+
penaltyTarget: SnapshotProbePenaltyTarget
310+
) -> DataPayload? {
311+
boundedBlockingSystemAlertSnapshotBody(
312+
deadline: deadline,
313+
penaltyTarget: penaltyTarget
314+
) { probeDeadline in
288315
#if AGENT_DEVICE_RUNNER_UNIT_TESTS
289316
if let override = self.systemModalProbeOverrideForTesting {
290317
return override(probeDeadline)
@@ -301,6 +328,7 @@ extension RunnerTests {
301328
/// production runs and what the unit tests exercise.
302329
private func boundedBlockingSystemAlertSnapshotBody(
303330
deadline: Date,
331+
penaltyTarget: SnapshotProbePenaltyTarget,
304332
probe: @escaping (Date) -> DataPayload?
305333
) -> DataPayload? {
306334
#if os(macOS)
@@ -316,6 +344,7 @@ extension RunnerTests {
316344
}
317345
let probeDeadline = Date().addingTimeInterval(slice)
318346
let startedAt = Date()
347+
let penaltyIdentity = SnapshotProbePenaltyIdentity(penaltyTarget)
319348
do {
320349
return try runMainThreadWork(
321350
"system_modal_probe",
@@ -329,12 +358,13 @@ extension RunnerTests {
329358
},
330359
onAbandoned: {
331360
self.penalizeSnapshotXCTestChannel(
332-
bundleId: self.currentBundleId,
361+
bundleId: penaltyIdentity.penalizedBundleId,
333362
reason: "system_modal_probe_timeout"
334363
)
335364
}
336365
) {
337-
probe(probeDeadline)
366+
penaltyIdentity.captureFromMain(bundleId: self.currentBundleId)
367+
return probe(probeDeadline)
338368
}
339369
} catch {
340370
NSLog(
@@ -413,37 +443,34 @@ extension RunnerTests {
413443
func querySweepSnapshotAcquisition(
414444
app: XCUIApplication,
415445
hint: CaptureHint,
416-
planDeadline: Date = .distantFuture
417-
) -> SnapshotAcquisition {
446+
sliceDeadline deadline: Date
447+
) -> (acquisition: SnapshotAcquisition, outcome: SnapshotTierOutcome) {
418448
var nodes: [RawAXNode] = [
419449
interactiveRootNode(rect: .zero)
420450
]
421451
if hint.rawTraversalDepth == 0 || hint.regularPresentedDepth == 0 {
422-
return SnapshotAcquisition(
423-
hint: hint,
424-
nodes: nodes,
425-
truncated: false,
426-
effectiveDepth: nil,
427-
viewport: .infinite,
428-
interfaceOrientation: RunnerInterfaceOrientation.unknown
452+
return (
453+
SnapshotAcquisition(
454+
hint: hint,
455+
nodes: nodes,
456+
truncated: false,
457+
effectiveDepth: nil,
458+
viewport: .infinite,
459+
interfaceOrientation: RunnerInterfaceOrientation.unknown
460+
),
461+
.completed
429462
)
430463
}
431464

432-
// Bounded by both its own sweep budget and the umbrella capture-plan deadline, so a
433-
// chained recovery tier can never push the plan past the main-thread watchdog (#1105).
434-
let sweepDeadline = hint.interactiveOnly
435-
? Date().addingTimeInterval(Self.flatInteractiveFallbackBudget)
436-
: Date.distantFuture
437-
let deadline = min(sweepDeadline, planDeadline)
438465
let viewport = safeSnapshotViewport(app: app)
439466
var seen = Set<String>()
440467
var candidates: [RawAXNode] = []
441468
let flatElements = flatInteractiveElements(app: app, deadline: deadline)
442-
var truncated = flatElements.truncated
469+
var outcome = flatElements.outcome
443470
for element in flatElements.elements {
444-
if Date() >= deadline {
471+
if !Self.querySweepCanStartQuery(deadline: deadline, now: Date()) {
445472
NSLog("AGENT_DEVICE_RUNNER_SNAPSHOT_FLAT_FALLBACK_DEADLINE")
446-
truncated = true
473+
outcome = .deadlineExhausted
447474
break
448475
}
449476
guard let node = flatSnapshotNode(element: element, index: 0, parentIndex: 0) else {
@@ -491,20 +518,25 @@ extension RunnerTests {
491518
)
492519
)
493520
}
494-
return SnapshotAcquisition(
495-
hint: hint,
496-
nodes: nodes,
497-
truncated: truncated,
498-
effectiveDepth: nil,
499-
viewport: viewport,
500-
interfaceOrientation: RunnerInterfaceOrientation.unknown
521+
return (
522+
SnapshotAcquisition(
523+
hint: hint,
524+
nodes: nodes,
525+
truncated: outcome == .deadlineExhausted,
526+
effectiveDepth: nil,
527+
viewport: viewport,
528+
interfaceOrientation: RunnerInterfaceOrientation.unknown
529+
),
530+
outcome
501531
)
502532
}
503533

504534
func snapshotAccessibilityUnavailable(failure: SnapshotCaptureFailure) -> DataPayload {
505535
NSLog("AGENT_DEVICE_RUNNER_SNAPSHOT_AX_UNAVAILABLE=%@", failure.message)
506-
runnerAccessibilityHealth = .unavailable
507-
invalidateCachedTarget(reason: Self.axSnapshotUnavailableReason)
536+
applyMainOwnedSnapshotState("ax_unavailable_invalidation") {
537+
self.runnerAccessibilityHealth = .unavailable
538+
self.invalidateCachedTarget(reason: Self.axSnapshotUnavailableReason)
539+
}
508540
// This is a planned terminal result, so it carries the structured verdict like every other
509541
// planned snapshot — downstream sparse handling keys off the verdict, not node shapes.
510542
return sparseTruncatedSnapshotPayload(

‎apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotAcquisition.swift‎

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ extension RunnerTests {
464464
func flatInteractiveElements(
465465
app: XCUIApplication,
466466
deadline: Date
467-
) -> (elements: [XCUIElement], truncated: Bool) {
467+
) -> (elements: [XCUIElement], outcome: SnapshotTierOutcome) {
468468
let queries: [XCUIElementQuery] = [
469469
app.buttons,
470470
app.links,
@@ -487,23 +487,36 @@ extension RunnerTests {
487487
app.images
488488
]
489489

490-
var elements: [XCUIElement] = []
491-
var truncated = false
490+
return Self.runFlatInteractiveQueries(queries, deadline: deadline) { query in
491+
self.snapshotElementsQuery {
492+
query.allElementsBoundByIndex
493+
}
494+
}
495+
}
496+
497+
/// Runs sweep queries in order until one reports AX unavailable, or until the next one could not
498+
/// finish before `deadline` (`querySweepCanStartQuery`). A sweep stopped by the deadline reports
499+
/// `.deadlineExhausted` rather than a truncation flag: what it collected is a partial tree, and
500+
/// only the caller that owns the tier decides whether that counts as an answer (#2781).
501+
static func runFlatInteractiveQueries<Query, Element>(
502+
_ queries: [Query],
503+
deadline: Date,
504+
now: () -> Date = { Date() },
505+
run: (Query) -> (elements: [Element], axUnavailable: Bool)
506+
) -> (elements: [Element], outcome: SnapshotTierOutcome) {
507+
var elements: [Element] = []
492508
for query in queries {
493-
if Date() >= deadline {
509+
if !querySweepCanStartQuery(deadline: deadline, now: now()) {
494510
NSLog("AGENT_DEVICE_RUNNER_SNAPSHOT_FLAT_FALLBACK_DEADLINE")
495-
truncated = true
496-
break
497-
}
498-
let result = snapshotElementsQuery {
499-
query.allElementsBoundByIndex
511+
return (elements, .deadlineExhausted)
500512
}
513+
let result = run(query)
501514
elements.append(contentsOf: result.elements)
502515
if result.axUnavailable {
503516
break
504517
}
505518
}
506-
return (elements, truncated)
519+
return (elements, .completed)
507520
}
508521

509522
func snapshotElementsQuery(

0 commit comments

Comments
 (0)