Skip to content

fix(chat): keep unknown system messages from rendering as chat bubbles - #6594

Merged
AndyScherzinger merged 1 commit into
masterfrom
fix/noid/sysMsgRendering
Aug 27, 2026
Merged

fix(chat): keep unknown system messages from rendering as chat bubbles#6594
AndyScherzinger merged 1 commit into
masterfrom
fix/noid/sysMsgRendering

Conversation

@AndyScherzinger

Copy link
Copy Markdown
Member

DUMMY is the marker for "not a system message", so mapping an unrecognised systemMessage identifier to it made getCalculateMessageType() classify the message as REGULAR_TEXT_MESSAGE. The server text then rendered in a chat bubble with avatar and actor name instead of as centered grey text, and every system message identifier added by a newer server regressed the same way.

Reserve DUMMY for what the server means by it, an empty systemMessage, and map any other unrecognised identifier to the new UNKNOWN type. Future server-side additions now render correctly without an app change, since their text comes from the server anyway.

Add the three identifiers the client was missing: preserve_conversation, preserve_conversation_off and phone_removed.

convertToString() had the same defect on the conversation list last-message path, which serialises ChatMessageJson into the conversation entity: CLEARED_CHAT was written as "clear_history" while parsing expects "history_cleared", and THREAD_RENAMED had no branch at all, so both came back as DUMMY. UNKNOWN serialises to a sentinel that parses back to UNKNOWN so it survives that round trip too.

getFromString() now takes String?, which is what LoganSquare passes for a null JSON value.

The new test asserts every enum member survives a convertToString -> getFromString round trip, which is what would have caught the "clear_history" typo.

Assisted-by: Claude Code:claude-opus-5

🖼️ Screenshots

🏚️ Before 🏡 After
B A

🚧 TODO

  • ...

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not needed
  • 🔖 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

DUMMY is the marker for "not a system message", so mapping an unrecognised
systemMessage identifier to it made getCalculateMessageType() classify the
message as REGULAR_TEXT_MESSAGE. The server text then rendered in a chat
bubble with avatar and actor name instead of as centered grey text, and
every system message identifier added by a newer server regressed the
same way.

Reserve DUMMY for what the server means by it, an empty systemMessage, and
map any other unrecognised identifier to the new UNKNOWN type. Future
server-side additions now render correctly without an app change, since
their text comes from the server anyway.

Add the three identifiers the client was missing: preserve_conversation,
preserve_conversation_off and phone_removed.

convertToString() had the same defect on the conversation list last-message
path, which serialises ChatMessageJson into the conversation entity:
CLEARED_CHAT was written as "clear_history" while parsing expects
"history_cleared", and THREAD_RENAMED had no branch at all, so both came
back as DUMMY. UNKNOWN serialises to a sentinel that parses back to
UNKNOWN so it survives that round trip too.

getFromString() now takes String?, which is what LoganSquare passes for a
null JSON value.

The new test asserts every enum member survives a convertToString ->
getFromString round trip, which is what would have caught the
"clear_history" typo.

Assisted-by: Claude Code:claude-opus-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
@AndyScherzinger AndyScherzinger added this to the 25.1.0 milestone Aug 27, 2026
@AndyScherzinger
AndyScherzinger requested a review from mahibi August 27, 2026 09:06
@AndyScherzinger AndyScherzinger added bug Something isn't working 3. to review Waiting for reviews labels Aug 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

APK file: https://github.com/nextcloud/talk-android/actions/runs/33057039930/artifacts/9641123126
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 marked this pull request as ready for review August 27, 2026 16:19
@AndyScherzinger

Copy link
Copy Markdown
Member Author

/backport to stable-25.0.x

@AndyScherzinger
AndyScherzinger merged commit 2b2f505 into master Aug 27, 2026
17 of 21 checks passed
@AndyScherzinger
AndyScherzinger deleted the fix/noid/sysMsgRendering branch August 27, 2026 16:20
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