Repository navigation
Stop paginating finds that can run inside a transaction - #5
Merged
Merged
Conversation
A paginated find makes Payload's Mongo adapter send the find and its count at once on the request's session. When that is the first query in a transaction, the two race to start it and one fails with NoSuchTransaction (about 1 in 7 in the positions plugin, where it was found). These finds only use the rows, so pagination: false drops the count and the race; any limit still applies. Lists that page for people (a page argument, totals returned) are left as they are. They run outside any transaction. Tested: typecheck and the full suite. The race itself isn't reproduced here; Whitehat's lint is meant to catch new cases. Task: K708 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
K708. 1 find(s) that pass
reqand only use the rows now passpagination: false, so the Mongo adapter doesn't send a count beside the find. As a transaction's first query, the two race and one fails with NoSuchTransaction (found in positions). Limits still apply. Paged lists for people are unchanged. Typecheck and the full suite pass locally.🤖 Generated with Claude Code