Bring the web client in line with the current API (closes #145) #175

Merged
clawbot merged 1 commits from issue-145-web-client-api into next 2026-10-21 05:48:34 +02:00
Collaborator

For #145, against the API as README.md and internal/handlers define it.

  • /mode +m and /mode +o nick send the change in body. /mode alone sends the query, and the 324 reply is printed.
  • Numeric replies are matched on code. 353 names are hostmasks; the nick is the part before !.
  • The member list takes @ and + from isOperator and isVoiced.
  • A 401 on the poll reloads the page. The reload's /state probe gets 401 and shows the login form.
  • The token code is gone. The page always probes /state on load to resume a session.

How each item was checked, in headless Chromium against make build with the bundle from web/build.sh:

  1. /mode +v bob, /mode +m, then /mode, reading the Server tab.
  2. /list, /who, /whois bob, reading the Server tab.
  3. The member list after +v bob, and again with /channels/*/members blocked so only 353 fills it.
  4. PASS, a second client logged in with curl sends QUIT, then the first page is watched.
  5. Request headers and localStorage keys recorded across login and a reload.

Disclosures:

  • Judgement call: the 401 path reloads the page, as /quit does, rather than resetting state by hand.
  • Further bug fixed: WHOIS 313 and 317 printed only their body. 311 now also shows user@host.
  • Not fixed, elsewhere: a MODE change sent to members prints only its body (+m).
  • Not fixed, elsewhere: saved channels are overwritten with [] on every page load, so a new session never rejoins them.

Model: opus-5-5

For https://git.eeqj.de/sneak/neoirc/issues/145, against the API as `README.md` and `internal/handlers` define it. - `/mode +m` and `/mode +o nick` send the change in `body`. `/mode` alone sends the query, and the 324 reply is printed. - Numeric replies are matched on `code`. 353 names are hostmasks; the nick is the part before `!`. - The member list takes `@` and `+` from `isOperator` and `isVoiced`. - A 401 on the poll reloads the page. The reload's `/state` probe gets 401 and shows the login form. - The token code is gone. The page always probes `/state` on load to resume a session. How each item was checked, in headless Chromium against `make build` with the bundle from `web/build.sh`: 1. `/mode +v bob`, `/mode +m`, then `/mode`, reading the Server tab. 2. `/list`, `/who`, `/whois bob`, reading the Server tab. 3. The member list after `+v bob`, and again with `/channels/*/members` blocked so only 353 fills it. 4. PASS, a second client logged in with curl sends QUIT, then the first page is watched. 5. Request headers and localStorage keys recorded across login and a reload. Disclosures: - Judgement call: the 401 path reloads the page, as `/quit` does, rather than resetting state by hand. - Further bug fixed: WHOIS 313 and 317 printed only their body. 311 now also shows `user@host`. - Not fixed, elsewhere: a `MODE` change sent to members prints only its body (`+m`). - Not fixed, elsewhere: saved channels are overwritten with `[]` on every page load, so a new session never rejoins them. Model: opus-5-5
clawbot added the needs-review label 2026-10-21 05:29:22 +02:00
clawbot self-assigned this 2026-10-21 05:29:22 +02:00
clawbot added 1 commit 2026-10-21 05:29:22 +02:00
The web client was written against an older shape of the API.

MODE now carries its change in `body`, so /mode sets modes; /mode
alone queries them and the 324 reply is shown. Numeric replies are
matched on `code`, so /list, /who and /whois print their lines, and
353 names are read as hostmasks. The member list takes @ and + from
`isOperator` and `isVoiced`. A 401 on the poll reloads the page, which
shows the login screen, where it used to retry for ever. The token
code is gone: no Authorization header, nothing stored, and the page
always asks /state whether it can resume a session.

Model: opus-5-5
Author
Collaborator

PASS

Model: opus-5-5

**PASS** Model: opus-5-5
clawbot removed the needs-review label 2026-10-21 05:43:48 +02:00
clawbot merged commit d37c130ee8 into next 2026-10-21 05:48:34 +02:00
clawbot deleted branch issue-145-web-client-api 2026-10-21 05:48:34 +02:00
Sign in to join this conversation.