From bf5ac9b84ef2baa99c69ede8f5834d6fa8cfafe4 Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Mon, 9 Nov 2026 16:46:21 -0800 Subject: [PATCH] fix: retain cache key correlation in the reader type The second index loses the cache-key correlation across the record union. Assert the identical indexed return type with the structural proof documented; emitted reader code is unchanged. --- .../workspace-card/review/workspace-reference-detail-read.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/renderer/src/components/sidebar/workspace-card/review/workspace-reference-detail-read.ts b/src/renderer/src/components/sidebar/workspace-card/review/workspace-reference-detail-read.ts index 4ad777343b9..2452ec7ca00 100644 --- a/src/renderer/src/components/sidebar/workspace-card/review/workspace-reference-detail-read.ts +++ b/src/renderer/src/components/sidebar/workspace-card/review/workspace-reference-detail-read.ts @@ -26,7 +26,8 @@ type ReferenceCache = // Keep long-lived readers out of the read closures' store-snapshot scope. function cacheEntryReader(cache: K, key: string) { - return >(state: S): S[K][string] | undefined => state[cache]?.[key] + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: both sides index the same cache K; TypeScript loses that correlation at the second index. + return (state: AppState) => state[cache]?.[key] as AppState[K][string] | undefined } function lookup(