1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-24 17:51:14 +02:00
unleash.unleash/frontend/src
Thomas Heartman a234e3a8c7
fix: cache eviction bug and the eternal loading screen (#10689)
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.
2025-09-24 14:51:16 +02:00
..
__mocks__
assets feat: GitHub auth (#10406) 2025-07-24 15:25:25 +01:00
component fix: Only show "not enough data" text when there isn't enough data. (#10604) 2025-09-03 12:23:36 +02:00
constants fix: date localizations for chart (#10581) 2025-09-01 09:29:45 +00:00
contexts feat: Unleash v7 ESM migration (#9877) 2025-05-14 09:47:12 +02:00
hooks fix: cache eviction bug and the eternal loading screen (#10689) 2025-09-24 14:51:16 +02:00
interfaces chore(AI): reportUnknownFlags flag cleanup (#10596) 2025-09-02 14:18:35 +01:00
openapi feat: read feature impact metrics (#10597) 2025-09-02 13:16:57 +02:00
themes Update chart colors to increase contrasts between the A series. (#10579) 2025-09-01 08:22:44 +02:00
types
utils feat: Display example date for date formatting reasons (#10444) 2025-07-31 11:07:32 +02:00
index.tsx feat: Unleash v7 ESM migration (#9877) 2025-05-14 09:47:12 +02:00
setupTests.ts
vite-env.d.ts