Skip to content

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

Merged
AndyScherzinger merged 2 commits into
masterfrom
claude/avatar-display-name-bug-6py3hv
Aug 23, 2026
Merged

fix(chat): don't freeze the author-info flag at first composition#6544
AndyScherzinger merged 2 commits 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.

🚧 TODO

  • Manual verification on a group chat

🏁 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

@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)

@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)

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 6a8c02b to c1ab098 Compare August 23, 2026 17:09
@github-actions

Copy link
Copy Markdown
Contributor

APK file: https://github.com/nextcloud/talk-android/actions/runs/32653946074/artifacts/9497037726
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)

Mention chips fell back to R.drawable.accent_circle whenever the avatar
request was still in flight or failed. That drawable is a bare oval
filled with colorPrimary, so a user chip - for example the actor in a
"{user} left the conversation" system message - rendered as a featureless
blue circle rather than a recognizable avatar placeholder. The chip's own
loadImage() uses the fallback for both .placeholder() and .error(), so
the circle showed up in both cases.

Add ic_circular_user, a gray circle with a white person glyph built the
same way as the existing ic_circular_group_mentions, icon_circular_team
and icon_circular_phone chip icons, and use it as the fallback for user,
guest and email chips. All chip fallbacks are now one visual family.

Applies to both chip renderers, since the Compose chip and the
MentionChipSpan in MarkdownText share resolveMentionFallbackIcon, and to
the legacy composer chips in DisplayUtils so the chip shown while typing
matches the one in the sent message. Self-mentions keep mention_chip,
whose dark circle is the deliberate contrast against the primary-colored
self chip.

Assisted-by: Claude Code:claude-opus-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
@AndyScherzinger

Copy link
Copy Markdown
Member Author

/backport to stable-25.0.x

@AndyScherzinger
AndyScherzinger merged commit 761b6ff into master Aug 23, 2026
17 of 19 checks passed
@AndyScherzinger
AndyScherzinger deleted the claude/avatar-display-name-bug-6py3hv branch August 23, 2026 18:36
@github-actions

Copy link
Copy Markdown
Contributor

APK file: https://github.com/nextcloud/talk-android/actions/runs/32658420756/artifacts/9498173326
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 modified the milestones: 25.0.0, 25.1.0 Aug 23, 2026
@AndyScherzinger AndyScherzinger added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Aug 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews AI assisted bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants