Repository navigation
feat(host): a board save is answered once its follow sees the transaction - #4446
Merged
Merged
Conversation
…tion The open task's board follow passes `onTxWait`, keeping the wait `liveRows` hands out while the board stands over Realtime, and a save waits on it with `confirmWrite` for the txid the service answered before it answers the window. A save answering no txid, or made while the board is polled or not followed, answers at once. The wait runs outside `serial`, so a slow transaction holds up no other task work. 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.
This is the host half of the board-save area in the txid rollout. When the window saves the whiteboard, the host waits until the board follow has seen the save's transaction, then answers the window. It builds on the shared wait from #4423 and on the service half, #4432, which made the save answer
txid.Ported from the txid half of #3757 (
11af552b/cc26ed92from that PR's earlier history).What changes
board-follow.ts:BoardFollowDependenciestakes an optionalonTxWaitand passes it toliveRows.compose-tasks.ts:followLivepasses an optionalonTxWaitthrough to the follow it runs.followBoardkeeps theTxWaitthe follow hands out, tagged with its task. When a follow is let go, it clears only the wait it handed out itself.tasks.boardSavecallsconfirmWrite(wait, saved.txid)before it answers{ saved: true }.serial, so a slow or missing transaction never holds up other task work. The board view is still written as soon as the save answers.confirmWrite's fallback.Tests
compose-tasks.test.ts, usingfakeRealtime:42doesn't answer while42is still awaited, and answers{ saved: true }oncearrive("42").Checks run: host typecheck; vitest on
compose-tasks.test.ts,board-follow.test.tsandlive-follow.test.ts; biome;./scripts/oxlint.sh.Made with Luke