Skip to content

fix: hand the foreground back after every broadcast start attempt (DRO-3369) - #40

Merged
Timo972 merged 1 commit into
masterfrom
timo/dro-3369-wda-broadcast-rotates-by-device-orientation-not-ui
Oct 15, 2026
Merged

Timo972 merged 1 commit into
masterfrom
timo/dro-3369-wda-broadcast-rotates-by-device-orientation-not-ui

Conversation

@Timo972

@Timo972 Timo972 commented Oct 15, 2026 •

Copy link
Copy Markdown

Problem

performBroadcastStartWithTimeout restored the previously active app only on success. Every failure after the runner was brought to the front (foregrounding timeout, picker error, confirmation tap error, extension connect timeout) returned with the runner's blank screen still in front. It then fed itself: the next attempt found the runner already frontmost (runnerIsActive), so previousApp stayed nil and nothing was restored, even when that attempt succeeded.

On the BYOD host (.88.200), 7 of 10 WDA phones were stuck like this. The phones lie on their side, so the blank runner rotated to landscape, and viewers saw a black, sideways frame.

Fix

The dance runs inside @try/@finally (the same pattern startBroadcastWithTimeout already uses), and the foreground is handed back on every exit when restoreForegroundApp is set: to the previously active app if one is known, otherwise to SpringBoard via fb_goToHomescreenWithError (a HOME button press does not reach SpringBoard on iOS 26). The dance body moves unchanged into runBroadcastDanceWithRunner:….

Verification

  • Scripts/ci/build-real.sh (scheme WebDriverAgentRunnerTunnel): build succeeded, no new warnings.
  • Hardware, iPhone 15 on iOS 26.6.1 (…14DA001C, lying on its side): after a failed start the foreground is now com.apple.springboard, PORTRAIT (previously the runner, LANDSCAPE).

The failure itself (408 on sideways phones) is fixed separately in #41.

Linear: DRO-3369

🤖 Generated with Claude Code

The broadcast start restored the previously active app only on success.
Every failure after the runner was brought forward (foregrounding
timeout, picker error, confirmation tap error, extension connect
timeout) left the runner's blank screen in front. The next attempt then
found the runner already frontmost, had no app to restore, and never
left it - even on success.

That blank runner is what the screenshot fallback and a later broadcast
capture, and on a phone lying on its side it rotates to landscape, so
viewers see a black, sideways frame (DRO-3369).

Restore on every exit path. When no previous app is known and the
runner is still in front, activate SpringBoard instead (a HOME press
does not reach SpringBoard on iOS 26).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Timo972
Timo972 requested a review from niko-droidrun October 15, 2026 09:39
@Timo972
Timo972 merged commit 7db42bd into master Oct 15, 2026
27 of 50 checks passed
@Timo972
Timo972 deleted the timo/dro-3369-wda-broadcast-rotates-by-device-orientation-not-ui branch October 15, 2026 09:53
@Timo972 Timo972 changed the title fix: hand the foreground back after every broadcast start attempt (DRO-3369) fix: broadcast start on phones lying on their side (DRO-3369) Oct 15, 2026
@Timo972 Timo972 changed the title fix: broadcast start on phones lying on their side (DRO-3369) fix: hand the foreground back after every broadcast start attempt (DRO-3369) Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants