deepgram-dotnet-sdk icon indicating copy to clipboard operation
deepgram-dotnet-sdk copied to clipboard

The ManageClient DeleteKey call hangs if calling it on already deleted keys / non-existing keys

Open leetal opened this issue 6 months ago • 0 comments

What is the current behavior?

Calling DeleteKey using the ManageClient takes an excessive amount of time (8+ seconds) to return when the specified key has already been deleted. We have a custom timeout set to 8 seconds, and this call consistently exceeds it when the key does not exist.

Steps to reproduce

  1. Use version 4.4.1 of the Deepgram .NET SDK.
  2. Attempt to delete a key via ManageClient.DeleteKey(...) where the key has already been deleted or does not exist.
  3. Observe that the operation "hangs" and eventually times out/returns an actual DeppgramRESTException after a very long time.

Expected behavior

The SDK should fail fast or return promptly with a suitable error/response if the key is already deleted or not found, rather than hanging for several seconds.

Please tell us about your environment

  • Operating System/Version: All common ones (Windows, MacOS and Linux)
  • .NET Version: .NET 7.0 (we're unable to upgrade to .NET 8.0 at this time)
  • Deepgram SDK Version: 4.4.1

Other information

Our current workaround is to call GetKey before invoking DeleteKey to ensure the key hasn't already been removed by another thread/process/service. This extra step avoids triggering our timeout handler, but it introduces unnecessary overhead and complexity. Ideally, DeleteKey should return more promptly if the key is already absent. We are EU-based but all other calls consistently takes around 1-2 seconds RTT, only this one is really slow.

leetal avatar May 13 '25 12:05 leetal