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

Null Responses Returned From AccountingApi Client #507

Open
phil000 opened this issue Mar 13, 2024 · 5 comments
Open

Null Responses Returned From AccountingApi Client #507

phil000 opened this issue Mar 13, 2024 · 5 comments

Comments

@phil000
Copy link

phil000 commented Mar 13, 2024

SDK you're using (please complete the following information):
Xero.NetStandard.OAuth2 4.0.1
Xero.NetStandard.OAuth2Client 1.6.0

Describe the bug
We have been using the Xero.NetStandard.OAuth2 packages for several years to integrate with Xero with no real issue.
In the last 2 months or so various API's have been returning a null 'response'.
We would not expect that. If the API call is successful we'd expect the response object back, otherwise if it is not successful we'd expect an exception telling us the issue.
This issue does not happen all the time, but happens occasionally, like twice a week.

Additionally, we have several customers that we integrate with Xero for using a Custom Connection, and the issue occurs across these different customers\connections.

e.g. This call can occasionally return a null 'response'

XeroModel.Attachments response = await _accountingApi.CreateInvoiceAttachmentByFileNameAsync(AccessToken, TenantId, guid, filename, fileData, includeOnline: true);

e.g. This call can occasionally return a null 'response'

XeroModel.Invoices response = await _accountingApi.CreateInvoicesAsync(AccessToken, TenantId, invoices);
  1. Does a null response indicate success or failure?
  2. How do we tell what the actual issue is if the response is null?
  3. Is there any log where we can review historical incidents to see the cause?
Copy link

PETOSS-404

Copy link

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

@phil000
Copy link
Author

phil000 commented Mar 14, 2024

Here is when it has occurred, in the last 30 days:

2/20/2024, 10:12:07.3756086 AM (Local time)
2/28/2024, 7:26:24.4069928 AM (Local time)
2/28/2024, 7:27:14.9976902 AM (Local time)
2/29/2024, 6:00:58.8381496 PM (Local time)
3/5/2024, 7:43:04.2017037 AM (Local time)
3/14/2024, 10:32:45.7978562 AM (Local time)
3/14/2024, 10:38:54.6725353 AM (Local time)

@phil000
Copy link
Author

phil000 commented Mar 27, 2024

Possibly the issue here? In DefaultExceptionFactory if the status code is 0 you get null returned.

I've see this happen (0 status code) when the issue is in the .Xero.NetStandard.OAuth2.Client.ApiClient itself.

image

@phil000
Copy link
Author

phil000 commented Apr 3, 2024

So we've started using the client methods ending in "WithHttpInfo" to gather a bit more information from the returned ApiResponse.

What we see when null is returned is that the ApiResponse StatusCode is 0, and the ErrorText is "The operation was canceled".

Response StatusCode: 0
Response ErrorText: The operation was canceled.
Response Body:

Looks like a client side timeout is causing the DefaultExceptionFactory to return null.

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