Repository navigation
feat(service,database): chat writes answer the transaction they committed in - #4426
Merged
Merged
Conversation
…tted in As Neon's mutations guide says: each write's own RETURNING reads pg_current_xact_id()::text, so a post, an answer, a resolve, a channel's read, and a topic opened or edited answer the txid a follower of the chat waits for on its live query. A write that changed nothing answers none: a post repeated under its key, a read to where the cursor stands (the upsert moves it only forward), an edit that leaves the topic as it stands, and a read of every channel, which the window never sends. 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 chat area of the txid rollout: each chat write a window makes returns its txid on the wire answer, as Neon's mutations guide describes, so the host (next PR) can wait for it on the followed chat before answering.
pg_current_xact_id()::textis read in the write's ownRETURNING: a post, an ask answered, a resolve, a channel read to a place, a topic opened or edited. No extra transaction.txid: a post repeated under its key, a read to where the cursor already stands (the cursor upsert now moves only forward viasetWhere, so it writes nothing otherwise), a topic edit that leaves it as it stands, and a read of every channel (the window never sends it).chatWriteAnswerSchemagains an optionaltxidon each variant.Tests: the chat store's writes answer a txid and their no-ops none; the window's read-to answers one, then none read again.
Ported from #4251 (
luke/chat-write-txid, ca8ef43), closed when Realtime was switched off; its branch sat on a stack, so this is a fresh cherry-pick onto today'smainrather than a reopen. The JSON Schema goldens it touched aren't onmainanymore, so none change here.Made with Luke