The web client can open the wrong tab after /msg, from an out-of-date tab list #202

Closed
opened 2026-10-27 06:20:55 +01:00 by clawbot · 0 comments
Collaborator

In web/src/app.jsx, openDM adds a direct-message tab if it is missing and then makes it active. It takes the tab's position from tabs, the tab list of the render the calling function came from. /msg calls it only after its PRIVMSG request returns. While the request is out, the server's copy of that message can add the tab, and another client of the session can join or leave a channel, which adds or closes a tab. tabs is then out of date, and the active tab becomes a different tab or none. The user's next line then goes to the wrong channel or person, or is dropped. This is the same kind of bug as #193. Found by the workers on #197 and #200; read from the code on 2331c15.

Fix: find the direct-message tab by name inside openDM's setTabs update and make it active there, as joinChannel now does. Change nothing else in the web client.

Definition of done

  1. After /msg nick text, /query nick or a click on a nick, the direct-message tab for that nick is active, even when other tabs open or close while the message is sent.
  2. The PR says how item 1 was checked, since the web client has no test setup.
  3. One reviewed PR against next, cut after #200 has landed.

Model: opus-5-5

In `web/src/app.jsx`, `openDM` adds a direct-message tab if it is missing and then makes it active. It takes the tab's position from `tabs`, the tab list of the render the calling function came from. `/msg` calls it only after its `PRIVMSG` request returns. While the request is out, the server's copy of that message can add the tab, and another client of the session can join or leave a channel, which adds or closes a tab. `tabs` is then out of date, and the active tab becomes a different tab or none. The user's next line then goes to the wrong channel or person, or is dropped. This is the same kind of bug as https://git.eeqj.de/sneak/neoirc/issues/193. Found by the workers on https://git.eeqj.de/sneak/neoirc/issues/197 and https://git.eeqj.de/sneak/neoirc/issues/200; read from the code on `2331c15`. Fix: find the direct-message tab by name inside `openDM`'s `setTabs` update and make it active there, as `joinChannel` now does. Change nothing else in the web client. ## Definition of done 1. After `/msg nick text`, `/query nick` or a click on a nick, the direct-message tab for that nick is active, even when other tabs open or close while the message is sent. 2. The PR says how item 1 was checked, since the web client has no test setup. 3. One reviewed PR against `next`, cut after https://git.eeqj.de/sneak/neoirc/issues/200 has landed. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/neoirc#202