I have an app that uses long-lived access tokens to upload files in the background. In order to migrate to using refresh tokens, I upgraded from .Net SDK 4.9.* to .Net SDK 6.*. The first call our app makes is to Files.GetMetadataAsync to determine if the file exists. I noticed that if the call results in an AuthException (invalid_access_token), the latency of the call is now 10-20 seconds, whereas before the upgrade this was under 1 second. I tried upgrading first to 6.0.1, and then to 6.2. Same result. There were 0 code changes with this upgrade; just an update of the Nuget package. I have rolled back this upgrade until the problem is better understood. I am using .Net core 3.1. Any ideas why?
I think I can answer my own question. We create the DropboxClient without specifying MaxRetriesOnError. In 6.*, this defaults to 4. If I set this to 0, then my code responds with latency values on par with the behavior in 4.9 SDK. So, I suspect the 6.* SDK is retrying on AuthException, whereas the 4.9 SDK did not. If it is retrying on AuthExceptions, this seems like a bug to me, especially if its an "invalid access token", as it is in my case. The token isn't suddenly going to change and become valid on a retry.