Repository navigation
feat(host): a chat write is confirmed once its transaction reaches the followed chat - #4444
Merged
Merged
Conversation
…e followed chat As Neon's mutations guide says: the chat follow hands its TxWait on (onTxWait) while it is subscribed over Realtime, and a write to that workspace's chat waits with confirmWrite on the txid the service answered before it answers the window, so the chat pushed to it already holds the write. A write that changed nothing answers no txid and waits for nothing, as does one to a chat not followed or polled. The host test drives the shared fake Realtime, whose awaitTxId settles only once the txid arrives. Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
|
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.
The host half of the chat area of the txid rollout, on top of the shared wait (#4423) and the chat service half (#4426, which answers each chat write's txid).
followWorkspaceChattakes an optionalonTxWaitand hands it toliveRows.compose-coding-agents.tskeeps each followed chat'sTxWaitby workspace (a follow lets go only its own, never a newer one's), andCODING_AGENTS_CHAT_POSTwaits withconfirmWriteon the answer's txid before answering the window.confirmWritedoes.Test:
compose-coding-agents.test.tsnow drives the sharedtesting/fake-realtime.ts(its local fake, whoseawaitTxIdresolved at once, is dropped). A write to a followed chat waits untilarrive("78"); a no-op write and a write to an unfollowed workspace answer at once with nothing awaited. The new test fails without the wait.Ported from #4253 (
luke/chat-write-txid-wait, 4f24be7), rewritten ontoconfirmWriteinstead of its hand-rolled wait.Made with Luke