Closed SOFSPEEL closed 5 months ago
OMG this one is a little tiny misstake with big consequences! My fix was just to not cache the cachekey into the methodset when cachekey is built from dynamic parameters values. Thanks for pointing that out to me!
Just pushed the preview 3 on NuGet including a fix for it. Let me know if it does actually fix it for you.
@JeremyBP Caching seems to be working properly now thanks for the quick fix.
Love your framework BTW!
I have setup Caching as follows:
Issue is when the constituentId parameter changes, the cached value based on the previous constituentId is returned.
I think the issue may arise here:
https://github.com/Respawnsive/Apizr/blob/078b3f987cd1a469645b2e7f855b5390c082f84e/Apizr/Src/Apizr/ApizrManager.cs#L2171C52-L2171C69
where this code returns without considering the [CacheKey].
Here is a some client pseudo-code that will fail:
singleSignOnTokenResult2 equals singleSignOnTokenResult1 as its not considering the passed in argument and hence pulls the cached value from the first call.
Here is a PR which may fix the issue: https://github.com/Respawnsive/Apizr/pull/21, but consider getting rid of _cachingMethodsSet too.