fix: retain conversation and tag mention identities on message reads - #99
Open
amanjoshicodes wants to merge 1 commit into
Open
amanjoshicodes wants to merge 1 commit into
amanjoshicodes wants to merge 1 commit into
Conversation
This branch has not been deployed
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Bug
message listandmessage getreturn"mentioned": {}for any mention that is not a person. An @everyone in a chat or channel, an @channel or @team, and a team tag mention are all stored by Graph and rendered by Teams, but the CLI's read-back shows them as unresolved.Root cause:
ChatMessageMentionedonly modelled theuserform of Graph'schatMessageMentionedIdentitySet, so serde dropped theconversationandtagidentities on deserialisation. Same class as thesubjectdrop fixed in #90: the send worked, the store was right, the read lied.Before / after
Channel root carrying an @everyone,
teams message get --team T --channel C ID -o json | jq '.data.mentions':[{"id":0,"mentionText":"Everyone","mentioned":{}}]with this change:
[{"id":0,"mentionText":"Everyone","mentioned":{"conversation":{"id":"19:...@thread.tacv2","displayName":"Everyone","conversationIdentityType":"channel"}}}]The same message in a group chat via
message list --chatgoes from"mentioned": {}to aconversationwithconversationIdentityType: "chat". A user mention on a neighbouring message is byte-identical before and after.Change
ChatMessageMentionedgainsconversation(teamworkConversationIdentity:id,displayName,conversationIdentityType) andtag(teamworkTagIdentity:id,displayName), both optional and omitted from JSON when absent, so messages without them gain nonullnoise. It now derivesDefault; the two places that build a user mention use struct update syntax.applicationanddeviceare deliberately left out (no delegated-flow use, nothing to verify against); an identity set holding only those still parses and prints as{}rather than failing the read. A test pins that.--mentionshape is unchanged; the existing exact-shape serialisation test still passes untouched.Tests
chat_message_keeps_conversation_mentions_on_channels_and_chats(round trip for bothchannelandchatidentity types)chat_message_keeps_tag_mentionschat_message_tolerates_unmodelled_mention_identitiescargo fmt --all --check,cargo clippy --all-targets --all-features -- -D warnings,cargo test --all-targets: 348 passed{}.