diff --git a/src/renderer/src/components/right-sidebar/ai-vault-session-identity.ts b/src/renderer/src/components/right-sidebar/ai-vault-session-identity.ts index f2101f75011..a4effa09096 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault-session-identity.ts +++ b/src/renderer/src/components/right-sidebar/ai-vault-session-identity.ts @@ -1,5 +1,5 @@ import type { AiVaultListResult, AiVaultSession } from '../../../../shared/ai-vault-types' -import { areValuesEqual } from '@/store/slices/repo-identity-reconcile' +import { structuralValuesEqual } from '../../../../shared/structural-value-equality' import { reuseEqualCatalogRows } from '@/store/slices/worktree-catalog-reconciliation' // One instance is shared by every mounted hook, so it is frozen: an in-place @@ -24,7 +24,9 @@ export function reuseAiVaultListResult( return incoming } const sessions = reuseEqualCatalogRows(current.sessions, incoming.sessions) - const issues = areValuesEqual(current.issues, incoming.issues) ? current.issues : incoming.issues + const issues = structuralValuesEqual(current.issues, incoming.issues) + ? current.issues + : incoming.issues if ( sessions === current.sessions && issues === current.issues && diff --git a/src/renderer/src/store/slices/github.ts b/src/renderer/src/store/slices/github.ts index 6134198b1c1..71cf753e662 100644 --- a/src/renderer/src/store/slices/github.ts +++ b/src/renderer/src/store/slices/github.ts @@ -78,7 +78,8 @@ import { normalizeGitHubPRForBranchOutcome } from '../../../../shared/github/pul import { restoreReactionOnSubject, setReactionOnSubject } from '@/lib/pr-comment-reactions' import { withGitHubCheckDetailsTimeout } from '@/runtime/github-check-details-timeout' import { getGitHubRepoLookupIndex } from './github-repo-lookup-index' -import { areValuesEqual, reconcileCatalogRows } from './repo-identity-reconcile' +import { reconcileCatalogRows } from './repo-identity-reconcile' +import { structuralValuesEqual } from '../../../../shared/structural-value-equality' // ─── ProjectV2 cache types ──────────────────────────────────────────── // Why: separate from CacheEntry — project-view has a single GraphQL source (no issue/PR fallback) and a distinct error union. @@ -2759,8 +2760,8 @@ export const createGitHubSlice: StateCreator = (s (row) => `${row.repoId}\0${row.id}` ) const nextFellBack = envelope.issueSourceFellBack ? true : undefined - const sourcesUnchanged = areValuesEqual(previousEntry?.sources, envelope.sources) - const errorUnchanged = areValuesEqual(previousEntry?.error, errorForCache) + const sourcesUnchanged = structuralValuesEqual(previousEntry?.sources, envelope.sources) + const errorUnchanged = structuralValuesEqual(previousEntry?.error, errorForCache) const fellBackUnchanged = previousEntry?.issueSourceFellBack === nextFellBack if ( previousEntry && diff --git a/src/renderer/src/store/slices/repo-identity-reconcile.ts b/src/renderer/src/store/slices/repo-identity-reconcile.ts index 7535422018a..ea118295754 100644 --- a/src/renderer/src/store/slices/repo-identity-reconcile.ts +++ b/src/renderer/src/store/slices/repo-identity-reconcile.ts @@ -61,7 +61,7 @@ export function reuseEqualRecordMap( const reconciled: Record = {} for (const key of nextKeys) { const existing = Object.hasOwn(previous, key) ? previous[key] : undefined - if (existing !== undefined && areValuesEqual(existing, next[key])) { + if (existing !== undefined && structuralValuesEqual(existing, next[key])) { reconciled[key] = existing continue }