v2.4.0
π·οΈ Add StaleTags to factory execution context
Community user @ted-mundy noticed a tricky behavior when using Tagging with stale entries (see next point).
To solve it, I added a new StaleTags property to the factory execution context, so that now it's possible to access both the tags that are being passed to the GetOrSet() call and the existing tags of the stale entry in the cache (if any), like this:
cache.GetOrSet<string>(
"foo",
(ctx, token) => {
// THE TAGS PASSED BELOW ("tag1", "tag2" and "tag3")
ctx.Tags;
// THE TAGS OF THE STALE ENTRY ALREADY IN THE CACHE, IF ANY
ctx.StaleTags;
return "Combo";
},
tags: ["tag1", "tag2", "tag3"]
);
This can be useful even in other scenarios, like applying some custom logic about what to do based on the tags already in the cache.
Nice.
π Fix for tags with stale entries
As mentioned above, community user @ted-mundy noticed a tricky behavior when using Tagging with stale entries.
Thanks to the addition of the new StaleTags property, this is now solved for good.
Thanks @ted-mundy !
See here for the original issue.
βοΈ Better entry options mapping with HybridCache adapter
Community user @TheSpookyElectric noticed that, when working with the HybridCache adapter, the LocalCacheExpiration was not being handled correctly in all cases.
The mapping logic has been updated to account for that, and it now works as expected.
Thanks @TheSpookyElectric !
See here for the original issue.
π Fix for WithRegisteredSerializer()
Community user @Inok noticed something... strange.
The builder, when calling WithRegisteredSerializer() on it, was doing something else: acting on the distributed cache.
That was, well... dumb, that's just what it was: my bad.
Now this has been solved.
Thanks @Inok !
See here for the original issue.
π Fix for InvalidOperationException when using AlwaysOffSampler with OTEL
Community user @DFSko noticed an InvalidOperationException being thrown when working with OTEL and using the AlwaysOffSampler: this had to do with setting the current Activity after certain operations, in conjunction with activities with a state not compatible for being set as the current one.
This has now been solved.
Thanks @DFSko !
See here for the original issue.
π Fix for an inline doc issue
Community user @marcominerva discovered a wrong description for the WithDistributedCache() method on the builder: fixed.
Thanks @marcominerva !
See here for the original issue.
β 1500 tests, huzza!
FusionCache reached 1500 tests:
That's it, that's the tweet π