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

implement/fix reverse iteration when iterating with ending_before #1100

Merged
merged 6 commits into from
Jan 7, 2021

Conversation

kaznovac
Copy link
Contributor

fixes #1090

implementation, similarly to stripe/stripe-dotnet#1848, reverses the order of the response list to prevent unexpected iteration
(example without reversing described in https://github.com/stripe/stripe-dotnet/pull/1854/files#r350498976)

@mnooblet
Copy link

nice, can we get this merged please?

@remi-stripe
Copy link
Contributor

We'll get to it in early January after the holidays!

@mnooblet
Copy link

We'll get to it in early January after the holidays!

great, happy new year ;)

Copy link
Contributor

@richardm-stripe richardm-stripe left a comment

Choose a reason for hiding this comment

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

Hi @kaznovac, very grateful for this PR! Thank you especially for the tests. I just have one request to avoid .reverse().

lib/autoPagination.js Outdated Show resolved Hide resolved
@richardm-stripe
Copy link
Contributor

Wrote a couple of extra tests while reviewing this to make sure I understood this change. You can merge them into your branch if you'd like, otherwise I will merge it afterwards:

kaznovac/stripe-node@reverse-iteration...richardm-stripe:richardm-reverse-iteration

Lots of whitespace noise because I added a describe unfortunately, but the new tests are

kaznovac/stripe-node@reverse-iteration...richardm-stripe:richardm-reverse-iteration#diff-4e53030d8c08ab9ded8e272ce6840dec73ec6d10d746382502f274378da2a474R529-R542

and

kaznovac/stripe-node@reverse-iteration...richardm-stripe:richardm-reverse-iteration#diff-4e53030d8c08ab9ded8e272ce6840dec73ec6d10d746382502f274378da2a474R580-R697

@richardm-stripe
Copy link
Contributor

Thank you so much for the contribution @kaznovac, we'll get this released shortly.

@richardm-stripe richardm-stripe merged commit 0149aa5 into stripe:master Jan 7, 2021
@mnooblet
Copy link

mnooblet commented Jan 7, 2021

@kaznovac @richardm-stripe thank you guys 🍺

@kaznovac kaznovac deleted the reverse-iteration branch January 8, 2021 14:28
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.

allow autoPaginate with ending_before
4 participants