fix batched snapshot db commits - #781
Merged
Merged
Conversation
Assisted-by: Claude:claude-sonnet-5
rr-
approved these changes
Jul 27, 2026
rr-
left a comment
Owner
There was a problem hiding this comment.
Well we do have tests for it so that's enough for me to greenlight it 👍 Thanks.
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 #780
Fixes a regression caused by the SQLAlchemy 2.0 migration. Not an expert on SA so apologies if I butcher this explanation:
SA2.0 introduced a feature where it "bundles" multiple statements into a single transaction. For most queries, that works perfectly fine, but for insertions into the snapshots table, that can cause issues because posts and tags have different identifiers (int vs str) and when combined together in the same transaction, SA/Postgres doesn't auto-cast the int to a str anymore.
The way to trigger this is to create a new post and tag simultaneously in the same REST query. The web UI never does this so it wasn't caught.
It's also not covered in the existing unit tests, so I added one for it.