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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stripe error during List pagination #207

Closed
seanpianka opened this issue Apr 7, 2022 · 2 comments 路 Fixed by #208
Closed

Stripe error during List pagination #207

seanpianka opened this issue Apr 7, 2022 · 2 comments 路 Fixed by #208
Labels
bug Something isn't working

Comments

@seanpianka
Copy link
Contributor

Hello! 馃憢 I'm using v0.14, and I'm currently seeing an error originating from Stripe when paginating through a List<Customer>:

Sample code:

let mut customers = Customer::list(&self.client(), params).await?;
let customer = loop {
    let customer = customers.data.iter().find(|c| { .. });
    if customer.is_some() {
        break customer;
    }
    if customers.has_more {
        customers =
            customers
                .next(&self.client())
                .await
                .map_err(|e| StripeClientError::StripeError {
                    cause: format!("failed to continue paginated listing: {:?}", e),
                })?;
    } else {
        break None;
    }
};

Error returned from customers.next(..) when invoked:

RequestError { http_status: 404, error_type: InvalidRequest, message: Some("Unrecognized request URL (GET: /v1/customers%3Fstarting_after=cus_LSeS5GLIpBPQSO). Please see https://stripe.com/docs or we can help at https://support.stripe.com/."), code: None, decline_code: None, charge: None }

Let me know if you see that I'm doing something obviously wrong, or if something else is going on. Thanks!

@arlyon
Copy link
Owner

arlyon commented Apr 7, 2022

Strange. At first glance, that %3F is surprising. I'll have a look, ty for the report. As a side note, one of the aims for this release cycle is test coverage so we'll make sure this issue doesn't occur again. Cheers!

@arlyon arlyon added the bug Something isn't working label Apr 7, 2022
@arlyon
Copy link
Owner

arlyon commented Apr 7, 2022

I pushed a PR to fix this (#208). Additionally, there is a known issue (#110) where params are not propagated properly when fetching more from a list. This (as well as a streaming api) will be fixed in #195.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants