You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Terminal button needs two clicks after another client closed the hidden drawer's terminal #28
If another client closes the terminal while your drawer is hidden, the next click on the terminal button does nothing. A second click opens the drawer with a new terminal.
hidden-drawer.mp4
Steps
Open a thread, open the drawer with the terminal button, then hide it again.
Close that terminal from another client: another browser, the phone app, or t3 on the server.
Click the terminal button.
Expected: the drawer opens with a new terminal. Actual: nothing visible happens. The second click opens it.
Reproduced in the web app with the fix from pingdotgg#39260 applied (b7ba5aac22). That fix doesn't touch this path, so main should behave the same, but I only checked that by reading the code.
Cause
A hidden drawer unmounts, so reconcileTerminalIds stops running for that thread. The store still lists term-1 locally and still remembers seeing it on the server. The terminal button finds a local terminal and only opens the drawer. The drawer mounts, its first reconcile sees the server dropped term-1, and it closes it. With no terminals left, the drawer closes.
The same stale id can affect project scripts. From the same state, findReusableProjectScriptTerminal can pick term-1, and the first reconcile closes it, so the script runs in a terminal the drawer no longer shows. This part was found in review and checked in a store test, not in the app.
Suggested fix
Bring the thread's terminal ids up to date with the server before the drawer opens or a script picks a terminal.
Activity