okta / okta-sdk-dotnet

A .NET SDK for interacting with the Okta management API, enabling server-side code to manage Okta users, groups, applications, and more.
Other
160 stars 100 forks source link

API Calls Trap Request Timeout Exceptions #632

Closed 9ee1 closed 1 year ago

9ee1 commented 1 year ago

Describe the bug?

When making an API call, if the request times out, there is no exception propagated to the caller. Instead a default value, depending on the method's signature, is returned. For example, UserApi.GetUserAsync(string) will return null. UserApi.ListUsers() will return an empty list once you enumerate it.

I am not sure if this is a bug or by design so I would appreciate a little bit of clarity. An API call that returns null can possibly be used to detect a connection timeout but something like an empty list makes this very difficult to detect. I have a scenario where I need to tell the difference between the API not finding any data and the API actually failing because of a transient connection error.

Thanks in advance.

What is expected to happen?

Any API call, such as UserApi.GetUserAsync(string) , should throw an exception if there is a connection timeout. Not trap it.

What is the actual behavior?

The exception is trapped.

Reproduction Steps?

  1. Create a UserApi instance. Use a dummy proxy (i.e. a non existent proxy address) to simulate a connection timeout
  2. Call UserApi.ListUsers() and enumerate the list
  3. An empty list is returned because of the connection timeout

Additional Information?

No response

.NET Version

7.0.201

SDK Version

6.0.7

OS version

No response

laura-rodriguez commented 1 year ago

Hi @9ee1,

Thanks for reporting this issue. I'll file an internal ticket for our team to review and prioritize.

Internal Ref: OKTA-596443

laura-rodriguez commented 1 year ago

Fixed in 6.0.8