You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
sbrownnw
2 years agoExplorer | Level 4
slow response time when calling Dropbox.Api (6.37.0) with expired access token
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).
- sbrownnwExplorer | Level 4
Running the same code with an invalid access token (empty string returns in less than 3 seconds on average):
- Greg-DBDropbox Staff
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).
- sbrownnwExplorer | Level 4
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.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,915 PostsLatest Activity: 5 hours agoIf you need more help you can view your support options (expected response time for an email or 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!