Skip to content

fix(chat): don't freeze the author-info flag at first composition - #6544

Open
AndyScherzinger wants to merge 1 commit into
masterfrom
claude/avatar-display-name-bug-6py3hv
Open

fix(chat): don't freeze the author-info flag at first composition#6544
AndyScherzinger wants to merge 1 commit into
masterfrom
claude/avatar-display-name-bug-6py3hv

Conversation

@AndyScherzinger

@AndyScherzinger AndyScherzinger commented Aug 22, 2026

Copy link
Copy Markdown
Member

Fixes group chats rendering incoming messages without the author's avatar and display name since the recent room-list/prefetching changes.

Root cause

ChatActivity.setChatListContent() read ChatUiState.isOneToOneConversation — which, despite its name, carries "show author avatars and names", i.e. !conversation.isOneToOneConversation() as set in ChatViewModel.observeConversation() — through remember { mutableStateOf(uiState.isOneToOneConversation) } without a key. That snapshots the field at the very first composition and never updates it again.

Whether that snapshot was correct was a race: it only held the real value when the conversation emission from the database reached uiState before the ComposeView's initial composition. Since the conversation list, chat opening and message prefetching moved onto local database flows (#6454, #6498), a chat opens straight from the cache and the first composition reliably runs before the conversation state lands — the flag stays frozen at its default false, and MessageScaffold (incoming && isOneToOneConversation && !isGrouped) never shows the avatar or the author name in group chats. The conversation-avatar caching (#6499) is not directly involved; chat-message avatars use the default Coil loader.

Fix

Read the flag directly from the collected uiState, so the message list recomposes with the real value once the conversation arrives. Also drops the debug log that would otherwise print on every recomposition.

Possible follow-up (deliberately out of scope for this fix): the field's inverted naming — isOneToOneConversation holding "is NOT one-to-one" across ChatUiState, ChatViewState, ChatMessageContext and the message composables — is what made this freeze hard to spot and is worth a rename.

🖼️ Screenshots

To be added during manual verification — the fix was developed in a remote environment without an emulator or test server, so no genuine screenshots could be captured. Expected: before, a group chat shows incoming messages without avatar/author name; after, ungrouped incoming messages show both.

🏚️ Before 🏡 After
screenshot pending screenshot pending

🚧 TODO

  • Manual verification on a group chat
  • Add before/after screenshots

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not needed — UI composition timing fix; no testable unit seam in ChatActivity
  • 🔖 Capability is checked or not needed
  • 🔙 Backport requests are created or not needed: /backport to stable-xx.x
  • 📅 Milestone is set
  • 🌸 PR title is meaningful (if it should be in the changelog: is it meaningful to users?)

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

🤖 Generated with Claude Code

https://claude.ai/code/session_01Nz3sNhRhLG4zkwVULowGW5

@github-actions

Copy link
Copy Markdown
Contributor

APK file: https://github.com/nextcloud/talk-android/actions/runs/32587171033/artifacts/9479465400
To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.
qrcode (please click on link to get QR code displayed)

@AndyScherzinger AndyScherzinger added this to the 25.0.0 milestone Aug 22, 2026
@AndyScherzinger AndyScherzinger added bug Something isn't working 2. developing Work in progress labels Aug 22, 2026
@AndyScherzinger
AndyScherzinger requested a review from mahibi August 22, 2026 20:36
@AndyScherzinger
AndyScherzinger force-pushed the claude/avatar-display-name-bug-6py3hv branch from 1808f79 to 1215fb4 Compare August 23, 2026 07:26
@github-actions

Copy link
Copy Markdown
Contributor

APK file: https://github.com/nextcloud/talk-android/actions/runs/32625591738/artifacts/9489667473
To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.
qrcode (please click on link to get QR code displayed)

The chat list content read ChatUiState.isOneToOneConversation - which,
despite its name, carries "show author avatars and names", i.e. the
negation of the conversation being one-to-one - through
remember { mutableStateOf(...) } without a key. That snapshots the
field at the very first composition and never updates it again, so the
value only ends up correct when the conversation emission from the
database happens to win the race against the ComposeView's initial
composition.

Since the room list, chat opening and message prefetching moved onto
local database flows, a chat opens straight from the cache and the
first composition reliably runs before the conversation state lands.
The flag then stays frozen at its default false and group chats render
every incoming message without the author's avatar and display name.

Read the flag directly from the collected uiState instead, so the
message list recomposes with the real value once the conversation
arrives. Also drop the debug log that would otherwise print on every
recomposition.

Assisted-by: Claude Code:claude-fable-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
@AndyScherzinger
AndyScherzinger force-pushed the claude/avatar-display-name-bug-6py3hv branch from 1215fb4 to 6a8c02b Compare August 23, 2026 07:46
@github-actions

Copy link
Copy Markdown
Contributor

APK file: https://github.com/nextcloud/talk-android/actions/runs/32626458502/artifacts/9489911495
To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.
qrcode (please click on link to get QR code displayed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2. developing Work in progress AI assisted bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants