From 622b7c5cc4a3b930b0483833429b40673c736f21 Mon Sep 17 00:00:00 2001 From: PJ Date: Sun, 7 Jun 2026 01:12:04 +0530 Subject: [PATCH] fix(ioscompanion): drop unresolved-value settle gate that never let empty-field screens settle --- internal/driver/ioscompanion/driver.go | 30 -------------------------- 1 file changed, 30 deletions(-) diff --git a/internal/driver/ioscompanion/driver.go b/internal/driver/ioscompanion/driver.go index 486f662..c5e522f 100644 --- a/internal/driver/ioscompanion/driver.go +++ b/internal/driver/ioscompanion/driver.go @@ -298,8 +298,6 @@ func (d *Driver) Launch(ctx context.Context, bundleID string, clearState bool, e return fmt.Errorf("launch %s: %w", d.bundleID, err) } - d.waitForAccessibilityReady(ctx) - if !d.pastePrimed { if err := warmUpPaste(ctx, d.makeRunner()); err != nil { fmt.Fprintf(d.output, "paste warm-up failed (continuing): %v\n", err) @@ -309,28 +307,6 @@ func (d *Driver) Launch(ctx context.Context, bundleID string, clearState bool, e return nil } -// accessibilityReadyTimeout bounds how long Launch waits for the freshly -// started app's accessibility tree to stop reporting placeholder values. -const accessibilityReadyTimeout = 10 * time.Second - -// waitForAccessibilityReady polls the accessibility dump until no element -// value reads as the bridge's unresolved-value sentinel. During app cold start -// the bridge reports "Invalid" for values it cannot resolve yet; a snapshot -// taken in that window shows phantom field content. Launch owns this wait so -// the first post-launch snapshot is trustworthy; the per-step settle cap is -// too short to absorb a cold start. -func (d *Driver) waitForAccessibilityReady(ctx context.Context) { - deadline := time.Now().Add(accessibilityReadyTimeout) - for time.Now().Before(deadline) && ctx.Err() == nil { - dump, err := d.describeAll(ctx) - if err == nil && !hasUnresolvedValues(dump) { - return - } - time.Sleep(StabilityPollInterval) - } - fmt.Fprintln(d.output, "accessibility tree still reports unresolved values after launch; first snapshot may be unreliable") -} - // clearAppState resets the app to a first-launch state. With an app path it // uninstalls and reinstalls; without one it falls back to wiping the app's data // container and warns once that a full reinstall needs the app path. @@ -594,12 +570,6 @@ func (d *Driver) WaitForIdle(ctx context.Context, _ time.Duration) error { if err != nil { return nil } - // Unresolved bridge values mean the tree is mid-update; report the - // snapshot transitional so the streak resets instead of declaring a - // half-readable screen stable. - if hasUnresolvedValues(dump) { - return nil - } mapped, err := MapHierarchy(dump, d.screenWidth, d.screenHeight) if err != nil { return nil