Skip to content

fix(hub): a conversation's calls leave for the store at once, not in the line of the hub's other calls - #497

Open
AVGVSTVS96 wants to merge 1 commit into
mainfrom
fix/transcripts-own-line
Open

AVGVSTVS96 wants to merge 1 commit into
mainfrom
fix/transcripts-own-line

Conversation

@AVGVSTVS96

@AVGVSTVS96 AVGVSTVS96 commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

Change

A hub start compares every open conversation with its copy in the store. That is 399 store calls for 197 conversations. Each of them waited in the one line all of the hub's store calls go through, behind whatever else the hub was asking, and a session's start waited in the same line for its conversation. On a busy hub one start took 32 minutes to finish the comparison.

Now the store client sends calls about a conversation's copy at once (atOnce in hub/store/remote.ts). They need no place in the line: the copy takes a call only where it stands as the caller last saw it, and the sender already sends one conversation's calls one after another. The hub's other calls keep their order, and no longer wait behind transcript pieces.

With that, two things in hub/transcripts.ts go:

  • its own process-wide line for sends, and the separate way a session's start asked the store to get around it;
  • twice(), a second ask stacked on the client's own resend of a call that got no answer.

Measured through the real client against the object's code, with every call taking 130 ms, 197 conversations in five hubs:

the hub's other calls in the line main #488's head this PR
none 62 s 62 s 29 s
5 a second 291 s 281 s 33 s
7 a second not done after 28 min, stopped not done after 28 min, stopped 33 s

#488 lets the status reads on the reading client go at once. Conversations go through the hub's own client, so it doesn't change this. The two merge without conflict, in either order, and their tests pass together.

Deploy

A hub restart. The store's Worker is unchanged.

Test

  • New: the client sends two calls about conversations at once while two other calls take turns (hub/store/storage.test.ts).
  • New: two conversations are sent side by side, each one's calls one after another (hub/transcripts.test.ts).
  • Both fail on main.
  • Removed: the test of the second ask. A dropped call is sent again by the client, which has its own test.

Left

  • Each hub still goes through its own conversations one after another at start: 29 s for 197 at 130 ms a call. No thread waits on that pass.
  • Nothing caps how many of these calls are out at once. There is one per conversation with something to send, one per hub's pass and one per starting session.
  • Calls about conversations no longer keep their place among the hub's other calls. I found nothing that relied on it: a stopping hub waits for its sends on their own, not through synced().
  • The hub's line itself stays busy with its other reads. That is not touched here.

…the line of the hub's other calls

A hub start compares every open conversation with its copy: 399 store calls for 197 conversations. They went one at a time through the hub's one line of store calls, behind every other call the hub makes, so on a busy hub the comparison took half an hour and a session's start waited in the same line.

The store client now sends calls about a conversation's copy at once. The copy takes a call only where it stands as the caller last saw it, and the sender already puts one conversation's calls in order, so they need no place in the line. The sender's own process-wide line goes with it, and so does its second ask on top of the client's own resend.
@vercel

vercel Bot commented Nov 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
hex Ready Ready Preview Nov 18, 2026 8:59pm UTC

Request Review

This branch was successfully deployed

1 active deployment
Preview — e15cce1f Deployed Nov 18, 2026 by vercel[bot]
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