Skip to content

Keep MLS replies to ten binary parts (GRYT-1528) - #247

Merged
sivert-io merged 1 commit into
mainfrom
claude/GRYT-1528-binary-parts
Sep 28, 2026
Merged

sivert-io merged 1 commit into
mainfrom
claude/GRYT-1528-binary-parts

Conversation

@sivert-io

@sivert-io sivert-io commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

What to look at

  • mls:sync hands out the oldest nine waiting Welcomes and sets moreWelcomes. It doesn't take a cursor. Acking the Welcomes a device has joined is what brings the next nine, which is what the core driver already does (core#24). One catch: a Welcome the driver can't take, and doesn't ack, stays at the front. If nine of those pile up, the ones behind them never arrive. That needs nine broken Welcomes for one device, so I left it.
  • mls:log:fetch now pages at ten entries, and ten is the default too. It was 100, with a maximum of 200. Any client asking for more gets ten and hasMore, which it already had to handle. The core driver asks for ten.
  • mls:keypackages:claim claims for nine devices at most, and lists any others in a new more field so the client can name them in devices next time. A DM has at most nine other devices (five each, minus your own), so more is always empty for now.
  • mls:keypackages:publish isn't changed. A 21-part publish gets dropped by socket.io before the handler sees it, and the driver sends nine at a time. The docs now say a publish carries ten at most.

Nothing else in mls.ts goes over: mls:commit sends at most two parts (commit and Welcome), and each push carries one.

Tests

Eleven Welcomes waiting come back as nine with moreWelcomes, then two after an ack. A log of twelve entries comes back ten at a time when asked for 200 and when no limit is given. A claim reply has more: []. Full suite: 1782 pass.

Task: GRYT-1528. Docs: Gryt-chat/docs#144. Separate from #246 (GRYT-1523), so each review stays about one thing.

🤖 Generated with Claude Code

socket.io-parser closes the connection on a packet with more than ten
binary parts. mls:sync sent every waiting Welcome in one reply, so a device
that eleven DMs added while it was offline got dropped on every connect and
never got past it.

mls:sync now sends the oldest nine and sets moreWelcomes. Acking them brings
the next nine. mls:log:fetch pages at ten entries whatever limit is asked
for, and ten is the default now too. mls:keypackages:claim claims for nine
devices at most and lists the rest in more. A DM has nine other devices at
most, so that one can't come up yet.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sivert-io
sivert-io marked this pull request as ready for review September 28, 2026 08:46
@sivert-io
sivert-io merged commit 4d0ff18 into main Sep 28, 2026
7 checks passed
@sivert-io
sivert-io deleted the claude/GRYT-1528-binary-parts branch September 28, 2026 08:47
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.

1 participant