core, ui: tolerate unknown MsgContentTag in chatContentTypes#6805
Merged
Conversation
Opening a group containing items with unknown/legacy msg_content_tag (e.g. "liveText") raised "Error loading details: chatContentTypes: ..." because strict enum decoding failed on the whole response. Follows the open-union pattern (GroupType/ReportReason): preserve the original type string in the Unknown variant so it round-trips.
9ff69e4 to
0cd1d93
Compare
epoberezkin
reviewed
Apr 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
msg_content_tagvalues (e.g."liveText"). Strict enum decoding ofList<MsgContentTag>inapiGetChatContentTypeswas failing on the whole response; backend already round-trips unknowns viaMCUnknown_, so the clients now do the same.GroupType/ReportReason: preserve the original type string in theUnknownvariant so it round-trips instead of collapsing to a sentinel.MsgContentTagbecomes asealed classwithobjectcases for known tags anddata class Unknown(val type: String); customMsgContentTagSerializermaps"liveText"→Textand wraps everything else inUnknown(s).apiGetChatContentTypesfilters outUnknown.MsgContentTagbecomes aCodable, Hashableenum withcase unknown(type: String);rawValueretained as a computed property so existing call sites compile unchanged."liveText"→.text;.chatcase added for parity with backend/multiplatform.apiGetChatContentTypesfilters out.unknown.Test plan
msg_content_tagon Android — group opens without the "Error loading details: chatContentTypes" error.