Repository navigation
fix(storage): delete a session in one transaction - #541
Merged
Merged
Conversation
The four deletes ran one by one, so a statement failing midway left a session listed with its messages already gone. They now commit together or not at all. Co-Authored-By: Claude Fable 5.2 <[email protected]>
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.
What
Database::delete_sessionran fourDELETEstatements one by one. If one failed midway, the session stayed listed with its messages already gone. They now run in one transaction: all four commit, or none does.Same change as the storage part of #526, with a test and without the working notes.
Test
a_failed_delete_leaves_the_session_wholedropssession_chunksso the third statement fails, then checks the session row and its message are still there.cargo test -p whycodes-storage: 46 passedwhycodes-storage: no missed lines-D warnings, budget scripts: ok🤖 Generated with Claude Code