Full-codebase-audit 2026-05-30 outputs: - Audit report: 09 - Audits/Full Codebase Audit - 2026-05-30.md - 81 issue files ISSUE-055..135 (decisions + 1 skipped no-brainer). - Scanner docs from scratch (was zero): architecture, data model, API ref, payment flow, operations runbook + repo README. - Doc-sync updates across API reference, data models, flows, design system. - Secret Rotation Runbook (08 - Operations) for the exposed credentials. - Reusable workflow guide (07 - Development) + .claude/workflows/full-codebase-audit.js. Issues remain status:open intentionally — the code fixes are uncommitted-then-committed working-tree changes per repo and aren't "resolved" until merged/deployed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
39 lines
1.2 KiB
Markdown
39 lines
1.2 KiB
Markdown
---
|
|
issue: 060
|
|
title: "Frontend contacts-popover reads userId from non-existent localStorage 'user' key"
|
|
severity: high
|
|
domain: Chat
|
|
labels: [bug, frontend]
|
|
status: open
|
|
created: 2026-05-30
|
|
source: Full Codebase Audit 2026-05-30
|
|
---
|
|
|
|
# Frontend contacts-popover reads userId from non-existent localStorage 'user' key
|
|
|
|
**Severity:** high
|
|
**Domain:** Chat
|
|
**Labels:** bug, frontend
|
|
|
|
## Description
|
|
|
|
`src/layouts/components/contacts-popover.tsx:61` reads `currentUserId` from `localStorage.getItem('user')`, but no part of the auth flow writes a `'user'` key to localStorage. The result is always `null`, breaking any per-user contact filtering in the popover.
|
|
|
|
## Options
|
|
|
|
1. Use the auth context (`useAuthContext`) to get the real user id.
|
|
2. Decode the user id from the access token claims.
|
|
3. Add a real `'user'` object to storage on login and read it here.
|
|
|
|
## Recommendation
|
|
|
|
Pull `currentUserId` from the live auth context rather than a non-existent storage key. Requires confirming the canonical user-id field name in the auth context.
|
|
|
|
## Affected Files
|
|
|
|
- `frontend/src/layouts/components/contacts-popover.tsx:61`
|
|
|
|
## References
|
|
|
|
- [Full Codebase Audit 2026-05-30](../09%20-%20Audits/Full%20Codebase%20Audit%20-%202026-05-30.md) — DEC-13
|