kontent-ai / delivery-sdk-net

Kontent.ai Delivery .NET SDK
https://www.nuget.org/packages/Kontent.Ai.Delivery
MIT License
32 stars 41 forks source link

Make DistributedCacheManager more robust #352

Closed gormal closed 1 year ago

gormal commented 1 year ago

Brief bug description

DistributedCacheManager can't handle failures of the underlying cache implementation.

Repro steps

  1. Failing unit test: https://github.com/kontent-ai/delivery-sdk-net/blob/cacheClient_failing_tests/Kontent.Ai.Delivery.Caching.Tests/DeliveryClientCacheTests.cs#L681

Expected behavior

DistributedCacheManager should fall back to the default client if the cache is unavailable.

DeliveryCacheOptions could be extended by one more property that would indicate that in case of failure of the underlying cache CacheManager would fall back to default DeliveryClient. Please note that this option should have an impact only on DistributedCacheManager implementation.

Also, consider logging as there should be a way to let customers know when their cache is unavailable.

ghost commented 1 year ago

Has any work been done with this issue? We have a temporary work around, but a fix in the SDK would be a much better solution.