Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion app/common/renderer/actions/SessionBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,13 @@ async function fetchAllSessions(baseUrl, headers) {
async function fetchSessionsFromEndpoint(url) {
try {
const res = await fetchSessionInformation({url, headers});
return url === seleniumSessionsEndpoint ? formatSeleniumGridSessions(res) : (res.value ?? []);
const value = url === seleniumSessionsEndpoint
? formatSeleniumGridSessions(res)
: (res.value ?? []);
// Some Appium servers return `{value: {error: "unknown command", ...}}` from these
// endpoints — a non-iterable object — which used to throw on the spread below and
// silently empty the session list. Treat any non-array as "no sessions".
return Array.isArray(value) ? value : [];
} catch {
return [];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,13 @@ const HeaderButtons = (props) => {
</Tooltip>
)}
<Tooltip title={t('Quit Session')}>
<Button id="btnClose" icon={<IconX size={18} />} onClick={quitSessionAndReturn} />
<Button
id="btnClose"
icon={<IconX size={18} />}
onClick={() =>
quitSessionAndReturn(window.AppLiveSessionId ? {detachOnly: true} : undefined)
}
/>
</Tooltip>
</Space.Compact>
);
Expand Down