fix(applive): post-prod hotfixes — bug 001 quit→restart hang#20
Merged
mayank2498 merged 2 commits intoMay 25, 2026
Merged
Conversation
Customer hit a stuck-on-loader state when reopening Appium Inspector in the same AppLive session after Quit. Root cause: the X button called quitSession() with no args, which sent DELETE /session and killed the WebDriver session AppLive depends on. In AppLive context (window.AppLiveSessionId truthy), the button must detach only. Desktop Inspector behavior is unchanged. Refs AL-13652, AL-13970. RCA: docs/post-prod-bugs/001-quit-restart-stuck.md
…oints
Some Appium/Selenium servers — observed on the BrowserStack hub after
a session is deleted — return {value: {error: 'unknown command', ...}}
from /appium/sessions. That non-iterable object propagated into a
Promise.all + spread, threw TypeError, and silently emptied the
running-sessions list, breaking auto-attach, the manual session
dropdown, and restart.
Refs AL-13652, AL-13970.
siddhesh-browserstack
approved these changes
May 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacked on #19. Two scoped post-prod fixes for AL-13970 — Appium Inspector v2026.2.1 hangs on the "Starting Appium Inspector" loader when the user clicks Quit then Start again inside the same AppLive session.
What's fixed
1. Quit Session in AppLive context must detach, not delete (
764bd71f)The X (Quit Session) button called
quitSession()with no args. In the new v2026.2.1 codebase that resolves todetachOnly: false, which sendsDELETE /session/<id>to the BrowserStack Appium hub — destroying the WebDriver session that AppLive depends on. On restart, the iframe re-loads with the same (now dead)sessionIdand auto-attach silently fails.Fix: in AppLive context (
window.AppLiveSessionIdtruthy), the X button now passes{detachOnly: true}. Desktop Inspector behavior is unchanged —window.AppLiveSessionIdisnullin the desktop URL, the ternary returnsundefined, and the action's defaultdetachOnly: falsestill fires the DELETE the desktop user wants.2.
fetchAllSessionstolerates non-arrayres.value(2d96fe78)Defensive. The BrowserStack hub was observed returning
{value: {error: "unknown command", ...}}from/appium/sessionsafter a session is deleted. That non-iterable object propagated into aPromise.all + spread, threwTypeError, and silently emptied the running-sessions list — breaking auto-attach, the manual session dropdown, and restart.Fix: guard with
Array.isArray(value) ? value : []. Independent of #1 but in the same code-path family — same bug 001 triggers it.Why not Task 2 from the original plan
The plan also proposed making the inactivity-timeout exit (
SessionInspector.jsx:248) detach instead of delete. Reverted during execution:NO_NEW_COMMAND_LIMITis 24h +SESSION_EXPIRY_PROMPT_TIMEOUTis 1h = 25h to reach this timer. AppLive sessions cap at <3h, so this path is unreachable in AppLive context. Pure gold-plating; would only add noise to the diff.How this was verified
Tested directly against production
app-live.browserstack.comusing Chrome DevTools Local Overrides — locally-built bundle staged at/tmp/chrome-prod-overrides/app-live.browserstack.com/appium-inspector/assets/v5/assets/index-BompXQej.js, served in place of the prod-hashed file. Everything else (auth, terminal allocation, devtools cluster, WebRTC, AppLive shell) hit real prod.DELETE /hub/sessionFull RCA
`docs/post-prod-bugs/001-quit-restart-stuck.md` in the `appium-inspector-upgrade-2026` workspace has the line-by-line analysis including HAR timeline, comparison with the v2024.12.1 behavior (post-message-then-await ordering masked the same bug), and dismissed-as-non-issue audit of `bindWindowClose` and `restartSession`.
Refs