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

MWS.orders.next don`t clear last request next_token #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wppurking
Copy link

In api/base.rb:50.

If i need 2 request to get all orders, after success run one times mws.orders.next even the last request do not return a 'next_token' the @next[:token] will persist the last request`s token, code like below will loop forever.

save_or_update_orders(response.orders)
while mws.orders.has_next?
  puts 'into next page...'
  save_or_update_orders(mws.orders.next.orders)
end

Because if next reponse do not have next_token then

if @response.respond_to?(:next_token) and @next[:token] = @response.next_token

will not execute @next[:token] = ...

pierrel referenced this pull request in blurb/ruby-mws Mar 13, 2014
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.

1 participant