Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
Hello. I am calling an established Dropbox account setup for an application with API access with what was once a valid access token that has expired. It takes about 15 seconds or more to obtain the AuthException: expired_access_token result. Why is this? The response should be in milliseconds, not 15 seconds or more.
Code is listed below (.Net Core 6.0 console app) with debug session showing the stopwatch running for over 20 seconds before exception was encountered:
Thanks for the report. It looks like the .NET SDK is unnecessarily retrying (repeatedly, with a backoff) on 'expired_access_token' failures. I'll ask the team to update it to skip the automatic retries on that kind of failure.
To work around this, you can make a DropboxClientConfig with maxRetriesOnError set to 0, and pass that to DropboxClient. That would prevent the automatic retries and eliminate the extra latency in this case. It would also prevent the automatic retries in cases where they may be useful though, so if you want to lower that extra latency without completely disabling automatic retries, you can set it to a number between 0 and 4 (since 4 is the default).
Running the same code with an invalid access token (empty string returns in less than 3 seconds on average):
Thanks for the report. It looks like the .NET SDK is unnecessarily retrying (repeatedly, with a backoff) on 'expired_access_token' failures. I'll ask the team to update it to skip the automatic retries on that kind of failure.
To work around this, you can make a DropboxClientConfig with maxRetriesOnError set to 0, and pass that to DropboxClient. That would prevent the automatic retries and eliminate the extra latency in this case. It would also prevent the automatic retries in cases where they may be useful though, so if you want to lower that extra latency without completely disabling automatic retries, you can set it to a number between 0 and 4 (since 4 is the default).
Thanks for the quick reply. Yes, your solution / workaround did make the response time better with using MaxRetriesOnError set to zero. I am still seeing response times of 6 to 12 seconds with this change. Seems like it should be 50% of the response times I am seeing when passing an expired token.
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!