You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
nikz
changed the title
#disconnect method issues a second API call
ApiClient#disconnect method issues a second API call
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 theGET
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?
The text was updated successfully, but these errors were encountered: