fix(config): invalidate in-flight fetch on section updates

This commit is contained in:
Supra4E8C
2026-03-27 22:01:40 +08:00
Unverified
parent f66deb36dd
commit 1bf7b23f75
+6 -1
View File
@@ -267,7 +267,12 @@ export const useConfigStore = create<ConfigState>((set, get) => ({
// 同时清除完整配置缓存
newCache.delete('__full__');
set({ cache: newCache });
// Section-level invalidation usually follows an optimistic write path. Invalidate any in-flight
// full fetch so stale responses can't overwrite newer local changes.
configRequestToken += 1;
inFlightConfigRequest = null;
set({ cache: newCache, loading: false, error: null });
return;
} else {
newCache.clear();