[Review] Add comment to vaultSettings type warning future contributors away from useShallow (which reintroduces #162) #188
Labels
No labels
blocked:depends-p1
blocked:gate-research
blocked:lint-failed
blocked:needs-decision
blocked:needs-human
blocked:verify-failed
bug
data-loss
documentation
enhancement
feature-request
in-progress
needs-decompose
needs-triage
pwa
quickfix
security
security/high
security/medium
test
test-coverage
triage-approved
vault
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/kimi_agent_kin_app_sync#188
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Finding
#162was fixed by replacinguseShallow(vaultSettings)with two primitive selectors (vaultEnabled,vaultAutoLockDelay) insrc/pages/Settings.tsx. Root cause:useShallowreturning a new object each time defeatsObject.isre-render semantics. The fix is correct.The hazard is that the pattern reads as "subscribe to all of vault state at once" — anyone adding a new field to
vaultSettingsin the future will reach foruseShallowagain because it looks natural, and re-introduce the same bug.Suggested fix
Add a code comment at the
vaultSettingstype declaration insrc/lib/store.ts(around line 253):Severity
Documentation. Prevents the bug from being re-introduced.
Discovered by
Manual code review pass over #162, 2026-09-14.
Closing as already-fixed.
Commit
bf676a6(docs(store): warn against useShallow on vaultSettings (closes #188)) landed onmainat 2026-09-14 (today, before this triage session reviewed the file).The chat-agent code review read against a stale HEAD and reported this issue as open. The fix was already in place when the review started — the agent failed to re-check HEAD between reads.
No work to do.