Repository navigation
feat(host): a sidebar pin or section write answers once the followed sidebar has its transaction - #4451
Merged
Conversation
…sidebar has its transaction The sidebar's follow hands the host its wait for a write's transaction (`onTxWait`) once its sections, entries, and pins are subscribed over Realtime, and none once let go or polled. Pinning or unpinning a repository, and every write to the sidebar's sections, now waits with `confirmWrite` on the txid the service answered before it draws the answer and answers the window, so a delivery from before the write never draws the old sidebar back. A write that changed no row names no txid, and a sidebar polled or not yet followed waits on nothing. 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 txid wait for repository pins and sidebar sections. It follows #4434, where those writes return their
txid, and builds on #4423, which added the sharedconfirmWrite/onTxWait.What changed:
workspaces-follow.ts:LiveReadDependenciestakes an optionalonTxWaitand passes it through toliveRows.compose-tasks.ts: the sidebar follow keeps the wait it is handed. That wait is cleared once the follow is let go or falls back to polling.TASKS_PIN_REPOSITORYandTASKS_WRITE_SECTIONnow callconfirmWrite(wait, txid)before they update the view and reply to the window. Without this, a Realtime delivery from before the write could put the old sidebar back on screen.Out of scope: task pins. They belong to the tasks-and-agents area.
Test (
compose-tasks.test.ts): before the first refresh, a write waits on nothing. Once the sidebar is followed, a section write and a repository pin each wait until their txid arrives. A pin that changed nothing replies at once. With theconfirmWritecall removed, the test fails.Made with Luke