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

Unable to get StripeResponse.RequestId from ListAutoPagingAsync() calls #2771

Open
antfitz opened this issue Sep 21, 2023 · 3 comments
Open

Comments

@antfitz
Copy link

antfitz commented Sep 21, 2023

Is your feature request related to a problem? Please describe.

Currently we sync data from the Stripe API and utilise the AutoPaging functionality of the SDK. When we receive the Stripe.Charge object back from looping a call to ListAutoPagingAsync(), there is no RequestId stored with object. The Charge.StripeResponse object is null.

Describe the solution you'd like

It would be good to be able to store the RequestId against each object returned from the ListAutoPagingAsync() call (and the other StripeResponse objects).

Describe alternatives you've considered

I can manaully write paginated calls to ListAsync() and using the StartingAfter or EndingBefore and get the headers for each call, but its just much easier to use the provided auto paging functionality of the SDK.

Additional context

No response

@richardm-stripe
Copy link
Contributor

Hi @antfitz, thank you for the feature request!

I agree it could be useful to see the request ids corresponding to the pagination request and it's unfortunate you can't do this when autopaginating.

Part of the issue is, normally we populate StripeResponse only on the top-level entity that is deserialized, but when you auto-paginate, the StripeResponse is put onto a page object that isn't accessible by the caller. We reach into the page object and return only the items in the page.

It would be easy to add a reference to StripeResponse on the list items when auto-paginating, but this feels wrong/inconsistent to me if we don't also follow through and add a similar reference to other non-top-level entities in other situations, and if we did that in this library we would probably want to add it for our libraries in other programming languages too. It's a real "if you give a mouse a cookie" situation.

I will discuss with the team, but I don't think we'll be able to provide a solution immediately. If you need the RequestId, I recommend manually paginating for now. Thank you for the request!

@antfitz
Copy link
Author

antfitz commented Oct 2, 2023

Thanks - will leave it with you guys!

@antfitz antfitz closed this as completed Oct 2, 2023
@anniel-stripe
Copy link
Contributor

anniel-stripe commented Oct 5, 2023

Hi there @antfitz ! We're going to keep this issue open to track it, if that's OK. To help us think about how useful adding this would be, can you share how you are using this request ID?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants