-
Notifications
You must be signed in to change notification settings - Fork 415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: No pagination when querying environments_v2
#3661
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I understand the code and it looks good. One question below.
assert results == [override_document, override_document] | ||
wrapper.table.query.assert_has_calls( | ||
[ | ||
mocker.call( | ||
KeyConditionExpression=mocker.ANY, | ||
), | ||
mocker.call( | ||
KeyConditionExpression=mocker.ANY, | ||
ExclusiveStartKey=last_evaluated_key, | ||
), | ||
] | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So just to make sure I'm understanding this correctly: All the pages are returned in a single call. The response to the client could potentially span multiple documents that could be quite long?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. We have a customer with thousands of identity overrides for a single feature which prompted us to come up with this fix
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3661 +/- ##
=======================================
Coverage 95.87% 95.87%
=======================================
Files 1099 1099
Lines 34457 34467 +10
=======================================
+ Hits 33034 33045 +11
+ Misses 1423 1422 -1 ☔ View full report in Codecov by Sentry. |
Thanks for submitting a PR! Please check the boxes below:
pre-commit
to check lintingdocs/
if required so people know about the feature!Changes
This adds pagination to
environments_v2
querying code to allow returning more than 1MB of identity overrides.How did you test this code?
Added a unit test for the case when DDB query gets more than one page of results.