Skip to content

[stable-25.0.x] fix(chat): keep unknown system messages from rendering as chat bubbles - #6602

Merged
AndyScherzinger merged 1 commit into
stable-25.0.xfrom
backport/6594/stable-25.0.x
Aug 27, 2026
Merged

[stable-25.0.x] fix(chat): keep unknown system messages from rendering as chat bubbles#6602
AndyScherzinger merged 1 commit into
stable-25.0.xfrom
backport/6594/stable-25.0.x

Conversation

@backportbot

@backportbot backportbot Bot commented Aug 27, 2026

Copy link
Copy Markdown

Backport of PR #6594

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>
@backportbot backportbot Bot added bug Something isn't working 3. to review Waiting for reviews AI assisted labels Aug 27, 2026
@backportbot backportbot Bot added this to the 25.0.0 milestone Aug 27, 2026
@AndyScherzinger
AndyScherzinger merged commit 9693cfc into stable-25.0.x Aug 27, 2026
10 of 15 checks passed
@AndyScherzinger
AndyScherzinger deleted the backport/6594/stable-25.0.x branch August 27, 2026 16:21
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.

1 participant