Skip to content

Catch-up: send CHATHISTORY TARGETS newer bound first (#216) - #217

Merged
rdrake merged 2 commits into
evilnet:developfrom
rdrake:claude/project-thread-wul7vq-216
Nov 8, 2026
Merged

rdrake merged 2 commits into
evilnet:developfrom
rdrake:claude/project-thread-wul7vq-216

Conversation

@rdrake

@rdrake rdrake commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #216.

CHATHISTORY TARGETS takes BETWEEN's semantics: the limit counts from the first argument, and the argument order sets the direction. The catch-up (client/js/irc/catchup.ts) sent the epoch first and now + 1 day second, and expected the newest 100 targets. Once the server follows the spec, that order returns the oldest 100, and an account in more than 100 channels gets its catch-up ordered by the wrong slice. Unlisted channels are still fetched, just later.

Change

  • Send CHATHISTORY TARGETS timestamp=<now + 1 day> timestamp=1970-01-01T00:00:00.000Z <limit>, the spec's own reconnect example. Today's server ignores the argument order, so this can land before the servers change.
  • The rest of CHATHISTORY TARGETS: send the newer bound first (the ircd will follow the spec's direction) #216 needs no code:
    • The answer is read into a map, so row order and tie groups at a page edge don't matter.
    • Both bounds are far outside real traffic, so exclusive bounds lose nothing.
    • The order is taken when the draft/chathistory-targets batch closes, without reading draft/chathistory-end, so a partial page is used like a full one.
    • chathistory-partial isn't negotiated.
  • test/irc/catchup.ts pins the newer-first order, and docs/projects/connect-burst.md notes why.

Testing

  • test/irc/client.ts and test/irc/catchup.ts: 107 passing.
  • pnpm typecheck, prettier and oxlint are clean. CI is green on this PR.

TARGETS takes BETWEEN's semantics: both bounds exclusive, the limit
counted from the first argument, the argument order sets the direction.
Seance sent epoch then now + 1 day and expected the newest 100; once the
ircd follows the spec (the fork's W5 Push E), that order returns the
oldest 100, so an account in more than 100 channels would have its
catch-up ordered by the wrong slice. Send now + 1 day first, the spec's
own reconnect example. The answer is read into a map, so its order,
its page edges and a missing draft/chathistory-end change nothing.

Closes evilnet#216
@rdrake
rdrake marked this pull request as ready for review November 8, 2026 14:36
@rdrake
rdrake merged commit 17635ed into evilnet:develop Nov 8, 2026
8 checks passed

This branch was previously deployed

1 inactive deployment
github-pages — 6e978e2a Deployed Nov 8, 2026 by rdrake via deploy #762
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CHATHISTORY TARGETS: send the newer bound first (the ircd will follow the spec's direction)

1 participant