Skip to content

fix: retain conversation and tag mention identities on message reads - #99

Open
amanjoshicodes wants to merge 1 commit into
osodevops:mainfrom
amanjoshicodes:fix/mention-identity-set
Open

amanjoshicodes wants to merge 1 commit into
osodevops:mainfrom
amanjoshicodes:fix/mention-identity-set

Conversation

@amanjoshicodes

Copy link
Copy Markdown
Contributor

Bug

message list and message get return "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: ChatMessageMentioned only modelled the user form of Graph's chatMessageMentionedIdentitySet, so serde dropped the conversation and tag identities on deserialisation. Same class as the subject drop 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 --chat goes from "mentioned": {} to a conversation with conversationIdentityType: "chat". A user mention on a neighbouring message is byte-identical before and after.

Change

  • ChatMessageMentioned gains conversation (teamworkConversationIdentity: id, displayName, conversationIdentityType) and tag (teamworkTagIdentity: id, displayName), both optional and omitted from JSON when absent, so messages without them gain no null noise. It now derives Default; the two places that build a user mention use struct update syntax.
  • application and device are 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.
  • The send-side --mention shape is unchanged; the existing exact-shape serialisation test still passes untouched.
  • CHANGELOG entry under Unreleased.

Tests

  • chat_message_keeps_conversation_mentions_on_channels_and_chats (round trip for both channel and chat identity types)
  • chat_message_keeps_tag_mentions
  • chat_message_tolerates_unmodelled_mention_identities
  • cargo fmt --all --check, cargo clippy --all-targets --all-features -- -D warnings, cargo test --all-targets: 348 passed
  • Live: release build read back a real @everyone channel root and a real @everyone group-chat message with the shapes above; the brew 0.7.0 binary read both as {}.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant