XeroAPI / xero-ruby

Xero Ruby SDK for OAuth 2.0 generated from XeroAPI/Xero-OpenAPI
http://developer.xero.com/
MIT License
58 stars 91 forks source link

ApiClient#disconnect method issues a second API call #256

Open nikz opened 1 year ago

nikz commented 1 year ago

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?

github-actions[bot] commented 1 year ago

PETOSS-296

github-actions[bot] commented 1 year ago

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