Repository navigation
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
Open
AVGVSTVS96 wants to merge 1 commit into
AVGVSTVS96 wants to merge 1 commit into
Conversation
…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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 (
atOnceinhub/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.tsgo: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:
#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
hub/store/storage.test.ts).hub/transcripts.test.ts).Left
synced().