From dcc3e52ad17c5ffdfc53da8046bfb7d5a9cd7efa Mon Sep 17 00:00:00 2001 From: Psychotoxical Date: Fri, 10 Apr 2026 17:50:52 +0200 Subject: [PATCH] fix(store): reset conflicting hot cache + preload state on rehydration Users who had both hotCacheEnabled and preloadMode !== 'off' before mutual exclusion was enforced will have both reset to off on next start. Co-Authored-By: Claude Sonnet 4.6 --- src/store/authStore.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/store/authStore.ts b/src/store/authStore.ts index 69e78791..17743de9 100644 --- a/src/store/authStore.ts +++ b/src/store/authStore.ts @@ -522,6 +522,11 @@ export const useAuthStore = create()( }, onRehydrateStorage: () => (state, error) => { if (error || !state) return; + // If both hot cache and preload were enabled before mutual exclusion was enforced, reset both. + const conflictingLegacyState = + state.hotCacheEnabled && state.preloadMode !== 'off' + ? { hotCacheEnabled: false, preloadMode: 'off' as const } + : {}; useAuthStore.setState({ mixMinRatingSong: clampMixFilterMinStars(state.mixMinRatingSong as number), mixMinRatingAlbum: clampMixFilterMinStars(state.mixMinRatingAlbum as number), @@ -529,6 +534,7 @@ export const useAuthStore = create()( skipStarManualSkipCountsByKey: sanitizeSkipStarCounts( (state as { skipStarManualSkipCountsByKey?: unknown }).skipStarManualSkipCountsByKey, ), + ...conflictingLegacyState, }); }, }