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

ApiClient#disconnect method issues a second API call #256

Open
nikz opened this issue Apr 7, 2023 · 2 comments
Open

ApiClient#disconnect method issues a second API call #256

nikz opened this issue Apr 7, 2023 · 2 comments

Comments

@nikz
Copy link

nikz commented Apr 7, 2023

https://github.com/XeroAPI/xero-ruby/blob/master/lib/xero-ruby/api_client.rb#L263-L268

When disconnecting a tenant, the gem issues a secondary request to list connections. This is a slightly strange API - generally I would expect a method like this to return a truthy value if the request has succeeded. An API call is generally relatively slow, and making two introduces many unwanted race conditions (for instance, what happens to program control flow if the DELETE request here passes but the GET for connections fails? Any retry logic I have will now need to take this possibility into account)

Additionally, I can call #connections again myself if I need a listing.

Would you accept a patch that removes this?

@nikz nikz changed the title #disconnect method issues a second API call ApiClient#disconnect method issues a second API call Apr 7, 2023
@github-actions
Copy link

github-actions bot commented Apr 7, 2023

PETOSS-296

@github-actions
Copy link

github-actions bot commented Apr 7, 2023

Thanks for raising an issue, a ticket has been created to track your request

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

No branches or pull requests

1 participant