When a tab navigates across render processes (e.g. an SSO redirect to another origin like login.account.rakuten.com), the debugger handle detaches and the session drops out of the relay maps, so the next command dead-ends with 'stale sessionId ... its tab is gone' — even open/navigate, which should always be able to drive the tab. But cb-tab-<tabId> encodes the STABLE Chrome tabId (#17), and the tab itself usually survives the nav. So before throwing, recoverSessionTab() parses the tabId out of the session, checks the tab still exists + is eligible, and re-attaches (attachTab re-mints the identical cb-tab-<tabId> session, keeping the daemon's binding valid), then the in-flight command retries against the recovered tab. Complements the 0.4.5 onDetach proactive re-attach: that heals on the detach event, this heals lazily on the next command if the event was missed. Falls back to the original error only when the tab is genuinely gone (closed/restricted).
30 KiB
30 KiB