Skip to content

Fix DM chat title showing the wrong username#6

Merged
Taure merged 1 commit into
masterfrom
fix/dm-chat-title
Jun 24, 2026
Merged

Fix DM chat title showing the wrong username#6
Taure merged 1 commit into
masterfrom
fix/dm-chat-title

Conversation

@Taure

@Taure Taure commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Problem

For 1-on-1 chats, the messages page set the header from chat.name. But chat.name is stored once at creation as the recipient's username from the creator's viewpoint (contacts.page.ts:56 sends name: user.username). It's a fixed string on the chat row, not per-viewer:

  • Alice DMs Bob -> row stores name = "bob"
  • Alice's title shows "bob" ✓
  • Bob's title shows "bob" (his own name), not "alice"

Fix

Derive the title per-viewer from the participant list (the server returns the other participants; the current user is appended client-side afterward). For a 1to1 chat with one other participant, use that participant's username; otherwise fall back to chat.name (group chats are unaffected). Extracted into a chatTitle() helper used by both the initial load and the post-invite update.

Verification

  • npm run lint - passes
  • npm run build - succeeds

For 1-on-1 chats, chat.name is stored once at creation as the recipient's
username from the creator's viewpoint, so the recipient saw their own name
in the title. Derive the title per-viewer from the other participant instead,
falling back to chat.name for group chats.
@Taure
Taure merged commit cac0fbf into master Jun 24, 2026
2 checks passed
@Taure
Taure deleted the fix/dm-chat-title branch June 24, 2026 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant