Skip to content

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

Open
rdrake wants to merge 2 commits into
developfrom
claude/project-thread-wul7vq
Open

rdrake wants to merge 2 commits into
developfrom
claude/project-thread-wul7vq

Conversation

@rdrake

@rdrake rdrake commented Nov 8, 2026

Copy link
Copy Markdown
Owner

Fixes evilnet#216.

CHATHISTORY TARGETS takes BETWEEN's semantics: both bounds are exclusive, 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. nefarious2 has returned the newest whatever the order, but once the fork's servers take W5 Push E they follow the spec, and that order returns the oldest 100. An account in more than 100 channels would then get its catch-up ordered by the wrong slice (unlisted channels are still fetched, just later).

Change

  • The request is now CHATHISTORY TARGETS timestamp=<now + 1 day> timestamp=1970-01-01T00:00:00.000Z <limit>, the spec's own reconnect example. It returns the newest limit targets on both the current and the spec-following server.
  • The other points in the issue need no code change. The answer is read into a map, so row order doesn't matter. The epoch and a day past now are far enough out that exclusive bounds lose nothing. Tie groups that are never split across a page edge are harmless. The answer is taken when the draft/chathistory-targets batch closes and never reads draft/chathistory-end, so a partial page is ordered just like a full one. chathistory-partial isn't negotiated.
  • Tests in test/irc/catchup.ts now pin the newer-first order. docs/projects/connect-burst.md records the order and why.

Testing

  • test/irc/client.ts and test/irc/catchup.ts: 107 passing
  • pnpm typecheck, prettier and oxlint pass on the changed files

Generated by Claude Code

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 self-assigned this Nov 8, 2026

This branch was previously deployed

1 inactive deployment
github-pages — b7f19e8f Deployed Nov 8, 2026 by rdrake via deploy #171
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)

2 participants