mirror of
https://github.com/hansjone/netx.git
synced 2026-10-09 03:10:46 +08:00
Fix WebCRT sessions killed by StrictMode ws_ticket reuse.
Allow short-lived tickets multiple uses, stop deleting PTY on transient websocket errors, and avoid marking connect complete after a dropped wait loop. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
b42f4eb588
commit
9314f11ce7
4 changed files with 62 additions and 17 deletions
|
|
@ -2341,14 +2341,19 @@ export function WebcrtPage() {
|
|||
void openTarget(tab.target, { force: true });
|
||||
return;
|
||||
}
|
||||
// Transient browser WS failures (StrictMode remount / ticket race) must
|
||||
// NOT delete the device PTY — keep session_id for reconnect/reattach.
|
||||
const transientWs =
|
||||
/^(websocket_error|websocket_closed)/i.test(String(message || "")) ||
|
||||
String(message || "").toLowerCase().includes("websocket");
|
||||
updateTab(tab.key, {
|
||||
status: "error",
|
||||
sessionId: "",
|
||||
wsUrl: "",
|
||||
status: transientWs ? "closed" : "error",
|
||||
sessionId: transientWs ? tab.sessionId : "",
|
||||
wsUrl: transientWs ? tab.wsUrl : "",
|
||||
connectPhase: undefined,
|
||||
errorMessage: webcrtErrorMessage(errMsg, t),
|
||||
});
|
||||
if (sid) {
|
||||
if (sid && !transientWs) {
|
||||
void closeWebcrtSession(sid).catch(() => undefined);
|
||||
}
|
||||
if (isInventoryTarget(tab.target) && isSshAuthFailure(errMsg)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue