-
Notifications
You must be signed in to change notification settings - Fork 179
Description
Describe the bug
HybridCache implementation does not clear all data when called RemoveByTagAsync("*") as is specified by Microsoft documentation
To Reproduce
using Microsoft.Extensions.Caching.Hybrid;
using Microsoft.Extensions.DependencyInjection;
using ZiggyCreatures.Caching.Fusion;
var serviceProvider = new ServiceCollection()
.AddFusionCache()
.WithDefaultEntryOptions(options =>
{
options.Duration = TimeSpan.FromMinutes(10);
})
.AsHybridCache()
.Services
.BuildServiceProvider();
var cache = serviceProvider.GetRequiredService<HybridCache>();
await cache.SetAsync("Key", "NotExpected");
await cache.RemoveByTagAsync("*");
var value = await cache.GetOrCreateAsync("Key", async t => await Task.FromResult("Expected"));
if (value != "Expected")
{
throw new Exception("Unexpected value: " + value);
}
Expected behavior
After calling RemoveByTagAsync("*") all data in cache should be removed
Versions
I've encountered this issue on:
- FusionCache: 2.5.0
- .NET version: 10.0
- OS version: Windows 11