xero-ruby icon indicating copy to clipboard operation
xero-ruby copied to clipboard

ApiClient#disconnect method issues a second API call

Open nikz opened this issue 1 year ago • 2 comments

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 avatar Apr 07 '23 01:04 nikz

PETOSS-296

github-actions[bot] avatar Apr 07 '23 01:04 github-actions[bot]

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

github-actions[bot] avatar Apr 07 '23 01:04 github-actions[bot]