Repository navigation
Answer a schema write with the change set it joined - #2667
Open
pournasserian wants to merge 4 commits into
Open
pournasserian wants to merge 4 commits into
pournasserian wants to merge 4 commits into
Conversation
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.
Closes #2615
What
create_content_typeandrevise_content_typenow answer from the change set their write joined, read by its id, instead of looking up the session's open set again after the write commits.IContentTypeDirectorygainsCreateInChangeSetAsyncandReviseInChangeSetAsync. They do whatCreateAsyncandReviseAsyncdo and return aContentTypeWrite: the content type and the id of the set the write joined.ContentTypeDirectorysets that id once the write has committed.CreateAsyncandReviseAsynckeep their shape and behaviour.ProposedWritereads the set withIChangeSetDirectory.GetAsync(id).nextthen says the set was submitted since, and that further changes go into a new set.ChangeSetTarget.ReadAsync, which only the tool used, is removed.IContentTypeDirectorystub the new methods.Why
Between the write and the second lookup, the agent could submit the set, or a concurrent write could open the session's next one. In the first case a committed write was answered with
change_set_not_found, which invites a retry and a second draft. In the second,ProposedWritedidn't find the operation and threw.Choices worth a look:
CreateAsyncandReviseAsynchave many callers, mostly tests, that only need the type. The new methods are additive, andIContentTypeDirectoryisn't an[ExtensionPoint].Tests
SchemaWriteAnswerTests, each on SQLite and PostgreSQL, call thecreate_content_typetool through a directory that lets another call in right after the write commits:checks_running, version 1, and the "submitted since" text.The existing schema tool and write tool tests pass unchanged. The full suite ran locally against a
postgres:17container as well as SQLite. No new package and no new project reference.Checklist
v2