Repository navigation
feat(database,service,features): a sidebar section's or repository pin's write answers the transaction it committed in - #4434
Merged
Conversation
…n's write answers the transaction it committed in Every write to the account's sidebar sections (make, edit, move, delete, and putting a task in a section or in none) and every repository pin or unpin reads `pg_current_xact_id()` in its own statement's RETURNING and answers it as `txid` on the PUT's answer, for the host to wait on its followed sidebar before it answers the window. A write that changed no row, such as a section given the title and icon it had, moved to the place it stood, made again under its id, a pin already pinned, or an unpin already gone, returns no row and answers no txid, so there is nothing to wait for. The section edit and move, and an entry's move, now skip a row that already stands so. 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 service half of the txid wait for the pins-and-sections area: every write the host's followed sidebar shows now answers the transaction it changed a row in, so the host can wait for it to land on the live view before it answers the window (host PR follows once #4423 merges).
What changed
task-section-store.ts: each mutating statement (insert, edit, move, delete a section, put/move/remove an entry) readspg_current_xact_id()::textin its ownRETURNING, as Neon's mutations guide does.writeTaskSectionsanswers it astxidbeside the sections. No extra transaction or statement.repository-pin-store.ts: pin and unpin return it the same way;setRepositoryPinanswers{ pins, txid? }.is distinct from), so a no-op writes nothing.taskSectionsWrittenSchemaandrepositoryPinsWrittenSchema(the GET answers plus an optionaltxid) are the PUT outputs;TaskClient.writeTaskSection/pinRepositoryanswer them. The host takes the sections and pins out of them as before and ignores the txid until the host PR.Old work: the txid half of #3960 (branch
luke/live-sidebar, andluke/live-sidebar-txid) was never pushed, and #3960's one commit carries no txid, so this is written fresh after the chat pattern in #4251.Out of scope: task pins (the tasks-and-agents worker's), Better Auth's writes, the agent tools' section writes (they get the txid from the store but wait on nothing).
Tests
task-section-store.test.ts).repository-pins-procedures.test.ts,task-sections-procedures.test.ts).Made with Luke