Repository navigation
feat(service,database): chat writes answer the transaction they committed in - #4251
Closed
charleslpan wants to merge 1 commit into
Closed
charleslpan wants to merge 1 commit into
charleslpan wants to merge 1 commit into
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. The write answers' JSON Schema goldens gain the optional txid. 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.
|
Contributor
This was referenced Oct 21, 2026
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.
Part of making workspace chat live over Neon Realtime. Stacked on #3916. One change: chat writes return their
txid, as Neon's mutations guide does it.What changes
txid from the write itself. Each chat write reads
pg_current_xact_id()::textin its ownRETURNING. The covered writes are:Chat writes run several statements in one transaction, so the txid comes from the write that changes the row, as the guide says. There's no extra round trip.
A write that changes nothing answers no txid, so there's nothing to wait for. That covers:
chat_readupsert only moves forward)is distinct from)Wire: each
chatWriteAnswerSchemavariant gains an optionaltxid.Store:
readTonow answers{ txid }orfalse. A message or channel row answered by a write carriestxid; one read back doesn't.The host's wait on the txid is #3923's child PR.
Tests
chat-store.test.tscase:coding-agents-app.test.tschecks that a read-to through the route carries the txid, and that a repeat carries none.chatWriteAnswerSchemaandcodingAgentChatWriteAnswerViewSchemawere regenerated underLUKE_UPDATE_FIXTURES=1. The only change is the optionaltxid.Made with Luke