mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-24 17:51:14 +02:00
Fixes an issue where the project feature list (and potentially other places in the app that use the `useClearSWRCache` hook) would end up in an infinite loading screen because the latest entry that we want to show was overwritten. The primary reason this happened is that we used `keysToDelete = array.slice(SWR_CACHE_SIZE - 1)`. Because the map keys are returned in insertion order, this would make us never delete the oldest keys, but always anything after the cache reached it's maximum size. The fix was to instead do `slice(0, -(SWR_CACHE_SIZE - 1))`, unless that is `0, 0`. If so, then just delete the entire filtered keys set. As a bonus: this PR also deduplicates cache entries that have the same query params but in different order for the feature search. This further reduces the cache space needed. |
||
---|---|---|
.. | ||
__mocks__ | ||
assets | ||
component | ||
constants | ||
contexts | ||
hooks | ||
interfaces | ||
openapi | ||
themes | ||
types | ||
utils | ||
index.tsx | ||
setupTests.ts | ||
vite-env.d.ts |