Repository navigation
Suppress 'R Session Disconnected' dialog on Desktop and during restart - #17140
Conversation
The onClientDisconnected handler was showing the disconnection popup unconditionally. This is wrong in two cases: 1. On Desktop, where the dialog should never appear (Desktop has its own session recovery mechanism triggered by process exit). 2. During a deliberate restart, where in-flight RPC requests may return INVALID_CLIENT_ID as the session resets, spuriously triggering the disconnect event. Add guards for both cases. The Desktop check mirrors the existing pattern in onQuit(). The restart check uses the existing isSuspendingAndRestarting() accessor on ApplicationQuit.
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
ReviewThe logic, style, and use of existing patterns ( Three concerns worth discussing: 1.
|
Move the isSuspendingAndRestarting() check before cleanupWorkbench() and return entirely. cleanupWorkbench() calls server_.disconnect(), which sets disconnected_ = true and kills the event listener. This would poison the RPC layer and silently break the ping loop in waitForSessionRestart, leaving the workbench hung with no recovery. See: #17140 (comment)
|
Pushed a fix for issue 1: the Re: issues 2 and 3 — both are mitigated by #17141 at the |
|
I don't see any "R Session Disconnected" dialog on R session restart. Tested on macOS Desktop and Ubuntu 24.04 Server. On my first attempt restarting on Server, I got into the state where the session has restarted but PA stays grey. |
Summary
The
onClientDisconnectedhandler inApplication.javawas showing the "R Session Disconnected" popup unconditionally. This is wrong in two cases:INVALID_CLIENT_IDas the session resets, spuriously triggering the disconnect event.Fix
Add guards for both cases in
onClientDisconnected():Desktop.isDesktop()check, mirroring the existing pattern inonQuit()pApplicationQuit_.get().isSuspendingAndRestarting()check, using the existing accessor onApplicationQuitTesting