fix: board header presence label uses username over email consistently (#683)#744
Conversation
…pshot When a board presence snapshot arrives from the SignalR hub the server may send the current user's email address as displayName. The idle-state seed uses the local session username, so the identity label was switching between the two formats whenever the user opened a card for editing. Introduce normalizePresenceMembers() in BoardView to replace the current user's displayName with the locally-known username before updating the presence list, making the label consistent across idle and editing states. Closes #683
Cover three scenarios: - current user email displayName is replaced with username in snapshot - other members' displayNames are left unchanged - snapshots for unrelated boards are ignored
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Self-review findingsLogic correctness
Type safety
Bonus improvement
Minor fix applied post-review
No real issues found. |
There was a problem hiding this comment.
Pull request overview
Updates the board presence handling in BoardView to keep the current user’s identity label stable (username vs email) when SignalR presence snapshots arrive, addressing the idle→editing label switch reported in #683.
Changes:
- Added
normalizePresenceMembers()inBoardView.vueto force the current user’s presencedisplayNametosessionStore.usernamewhen applying presence snapshots. - Updated presence snapshot handling to store/use the normalized member list.
- Added vitest coverage for current-user normalization, “other member unchanged”, and “ignore other board snapshot” regression cases.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| frontend/taskdeck-web/src/views/BoardView.vue | Normalizes current user presence displayName before updating local/store presence state. |
| frontend/taskdeck-web/src/tests/views/BoardView.spec.ts | Adds unit tests validating normalization behavior and board scoping of snapshots. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Code Review
This pull request addresses issue #683 by implementing display name normalization in BoardView.vue to ensure the current user's identity label remains consistent. It also adds unit tests to verify this normalization and ensure snapshots for other boards are ignored. Feedback suggests centralizing the normalization logic in a store or utility for better reusability.
| function normalizePresenceMembers(members: BoardPresenceMember[]): BoardPresenceMember[] { | ||
| const currentUserId = sessionStore.userId | ||
| const currentUsername = sessionStore.username | ||
| if (!currentUserId || !currentUsername) return members | ||
| return members.map((m) => | ||
| m.userId === currentUserId ? { ...m, displayName: currentUsername } : m, | ||
| ) | ||
| } |
There was a problem hiding this comment.
While this normalization logic correctly addresses the issue in BoardView, it might be more robust to handle this transformation within the boardStore or a shared utility. If other views eventually display presence data, they would benefit from a centralized normalization of the current user's display name. However, for the current scope of fixing the idle-to-editing label switch in this component, this implementation is functional.
Adversarial review — PR #744 (fix/#683 board header presence label)SummaryThe fix is correct and safe. All 1544 frontend unit tests pass locally. Detailed findings below. CI failuresAPI Integration fails on both ubuntu and windows — this is a pre-existing failure unrelated to this PR. The root cause is Adversarial checklist1. Does the fix handle 2. Could normalization run before sessionStore is hydrated? 3. Are the tests asserting the right thing? One gap: there is no test for the 4. Are there other places in the codebase with the same bug? 5. Does the fix break multi-user boards? 6. Does the fix affect the presence seed on mount? Minor findings (no action required)
VerdictApproved for merge once the pre-existing |
Updates STATUS.md, TESTING_GUIDE.md, MANUAL_TEST_CHECKLIST.md, and IMPLEMENTATION_MASTERPLAN.md to reflect the 9 PRs merged in the 2026-04-04 post-adversarial-review hardening wave. - STATUS.md: adds new wave entry for PRs #741–#756 covering product telemetry taxonomy, two bug fixes (#683/#744, #680/#754), six frontend regression test additions, and two backend webhook test additions; updates Last Updated date - TESTING_GUIDE.md: updates frontend count from 1496 to 1592, backend estimate to ~3010+, combined total to ~4600+; marks #710 and #726 as delivered in wave table; adds resolved entries to Key Gaps section; updates telemetry taxonomy note to delivered; appends three new coverage sections for webhook HMAC, SSRF/delivery reliability, and frontend regression wave - MANUAL_TEST_CHECKLIST.md: adds auth-flow toast check (Section A), WIP-limit dedup check (Section B), manual card provenance empty state check (Section B), board header presence label check (Section B), and D2 router auth guard and workspace state section - IMPLEMENTATION_MASTERPLAN.md: adds item 128 for the post-adversarial hardening wave with all 9 issues, fixes, and wave progress update
Summary
normalizePresenceMembers()inBoardView.vuethat replaces the current user'sdisplayNamewith the locally-knownsessionStore.usernamebefore applying any incoming SignalR presence snapshotdemo@taskdeck.local) while the local seed uses the short username (demo)Test plan
demo, open a board, verify label showsdemo— open a card, verify label still showsdemo (editing)notdemo@taskdeck.local (editing)