Skip to content
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: paginators not respecting start key #1101

Merged
merged 3 commits into from
Jun 17, 2024
Merged

Conversation

0marperez
Copy link
Contributor

Issue #

aws-sdk-kotlin#1330

Description of changes

Check if start key is exists before setting it to null

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

This comment has been minimized.

@0marperez 0marperez marked this pull request as ready for review June 14, 2024 14:49
@0marperez 0marperez requested a review from a team as a code owner June 14, 2024 14:49
@@ -148,7 +148,7 @@ class PaginatorGenerator : KotlinIntegration {
write("")
withBlock("while (hasNextPage) {", "}") {
withBlock("val req = initialRequest.copy {", "}") {
write("this.$markerLiteral = cursor")
write("this.$markerLiteral = this.$markerLiteral ?: cursor")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question / correctness: Won't this logic always use the initialRequest.$markerLiteral if it's not null? How does the cursor get updated to fetch the second page in that case?

I was expecting the fix to be changing L146 to:

write("var cursor: #F = initialRequest.#L", cursorSymbol, markerLiteral)

This will be null when the initialRequest.$markerLiteral is not set, preserving existing behavior

{
"id": "15fb7dc6-dee9-4f40-adba-a48183d4f432",
"type": "bugfix",
"description": "Paginators not respecting start key",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: usually the changelog description should finish the sentence "This PR will..."

"Fix paginators not respecting start key"

Copy link

Affected Artifacts

No artifacts changed size

@0marperez 0marperez merged commit e639316 into main Jun 17, 2024
15 checks passed
@0marperez 0marperez deleted the respect-exclusivestartkey branch June 17, 2024 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants