History paging takes an id no response gives the client #125

Closed
opened 2026-10-08 08:48:59 +02:00 by clawbot · 2 comments
Collaborator

GET /api/v1/history pages with before, a database id (internal/handlers/api.go), but the messages it returns carry only their UUID as id, so a client has no value to pass for the next page. Found while checking the README against the code for #120.

Reading taken: before takes the message id the responses already carry, and the server looks up its position; no internal id is exposed.

Definition of done

  1. A client can page back through a channel's history using only values from earlier history responses.
  2. An unknown before id gets a clear error, not a silent full page.
  3. A handler test pages through more than one page; README.md's history section matches.
  4. One reviewed PR against next.

Model: opus-5-5

`GET /api/v1/history` pages with `before`, a database id (`internal/handlers/api.go`), but the messages it returns carry only their UUID as `id`, so a client has no value to pass for the next page. Found while checking the README against the code for https://git.eeqj.de/sneak/neoirc/pulls/120. Reading taken: `before` takes the message `id` the responses already carry, and the server looks up its position; no internal id is exposed. ## Definition of done 1. A client can page back through a channel's history using only values from earlier history responses. 2. An unknown `before` id gets a clear error, not a silent full page. 3. A handler test pages through more than one page; `README.md`'s history section matches. 4. One reviewed PR against `next`. Model: opus-5-5
clawbot self-assigned this 2026-10-08 08:49:00 +02:00
Author
Collaborator

Plan: one PR against next taking the reading recorded above. before takes the message id the history responses already carry; the server finds that message's position and returns the page before it. An unknown before id gets a clear 4xx error. A handler test pages back through more than one page using only values from earlier responses; README.md's history section updated.

Model: opus-5-5

Plan: one PR against `next` taking the reading recorded above. `before` takes the message `id` the history responses already carry; the server finds that message's position and returns the page before it. An unknown `before` id gets a clear 4xx error. A handler test pages back through more than one page using only values from earlier responses; `README.md`'s history section updated. Model: opus-5-5
Author
Collaborator

Built in #136: before on GET /api/v1/history now takes the id of a message sent to target, and the server returns the messages older than it. An id with no such message, including one from another channel, gets 400 unknown before id. A handler test pages back through a channel using only ids from earlier responses, and README.md's history section matches.

Model: opus-5-5

Built in https://git.eeqj.de/sneak/neoirc/pulls/136: `before` on `GET /api/v1/history` now takes the `id` of a message sent to `target`, and the server returns the messages older than it. An `id` with no such message, including one from another channel, gets `400` `unknown before id`. A handler test pages back through a channel using only ids from earlier responses, and `README.md`'s history section matches. 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#125