Skip to content

feat(host): a board save is answered once its follow sees the transaction - #4446

Merged
luke-agent[bot] merged 1 commit into
mainfrom
luke/board-save-txid-wait
Oct 21, 2026
Merged

luke-agent[bot] merged 1 commit into
mainfrom
luke/board-save-txid-wait

Conversation

@charleslpan

@charleslpan charleslpan commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

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 / cc26ed92 from that PR's earlier history).

What changes

  • board-follow.ts: BoardFollowDependencies takes an optional onTxWait and passes it to liveRows.
  • compose-tasks.ts:
    • followLive passes an optional onTxWait through to the follow it runs.
    • followBoard keeps the TxWait the follow hands out, tagged with its task. When a follow is let go, it clears only the wait it handed out itself.
    • tasks.boardSave calls confirmWrite(wait, saved.txid) before it answers { saved: true }.
    • The wait runs outside 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.
  • The answer goes out at once when the save carries no txid (an elements-only or unchanged save, see feat(service): a board save answers the transaction that moved its live row #4432), when the board is polled, or when no follow stands. That is confirmWrite's fallback.

Tests

compose-tasks.test.ts, using fakeRealtime:

  • A save that answers txid 42 doesn't answer while 42 is still awaited, and answers { saved: true } once arrive("42").
  • A save with no txid answers at once.
  • After the follow stops and isn't sealed again (no wait), a save with a txid answers at once and leaves nothing awaited.

Checks run: host typecheck; vitest on compose-tasks.test.ts, board-follow.test.ts and live-follow.test.ts; biome; ./scripts/oxlint.sh.

Made with Luke

View guided diff Turn on auto-fix


Devin Review

…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>
@vercel

vercel Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
luke-web Ready Ready Preview Oct 21, 2026 9:05pm UTC

Request Review

@luke-agent
luke-agent Bot added this pull request to the merge queue Oct 21, 2026

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Devin Review

Comment thread packages/host/src/compose-tasks.ts Resolved
Merged via the queue into main with commit d5cd71d Oct 21, 2026
12 checks passed
@luke-agent
luke-agent Bot deleted the luke/board-save-txid-wait branch October 21, 2026 21:14

This branch was successfully deployed

1 active deployment
Preview — 3d6398d4 Deployed Oct 21, 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