Fix nested edges pagination#329
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes a truncation bug in get_entities_links where shared child cursor state could be overwritten when multiple parents were fetched in the same outer page. The workaround forces one-parent-at-a-time pagination whenever a query contains nested edge fields, trading throughput for correctness.
Changes:
- In
EdgesField.get_filters, cap the outer page limit to 1 whenchild_has_edgesis true, so each outer query returns a single parent and its child cursor cannot be clobbered.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
get_entities_links
iLLiCiTiT
approved these changes
May 15, 2026
iLLiCiTiT
reviewed
May 15, 2026
iLLiCiTiT
approved these changes
May 15, 2026
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.
Changelog Description
Fix truncation over 300 for
get_entities_linksAdditional review information
This isn't the optimal fix - but it's the simplest one.
So instead of this broken shape:
links._cursor/links._need_querygets overwritten while processing that mixed batchit becomes:
This means that as pagination gets involved, it'll also paginate each 'parent' entity id one by one to avoid the bug essentially.
The only other means would be to actually keep track of the cursor state of each parent when nested pagination is involved. That would need to:
It adds a lot of complexity for not having to do ALL parents one by one, but only the select few you know require pagination.
This workaround: everything becomes one-parent-at-a-time immediately
Proper fix: first query can still fetch up to 300 parents at once, and only the parents with unfinished nested pagination get replayed individually afterward
Testing notes: