fix: preserve chatMessage subject on reads and add message send --subject - #90
Open
amanjoshicodes wants to merge 1 commit into
Open
fix: preserve chatMessage subject on reads and add message send --subject#90amanjoshicodes wants to merge 1 commit into
amanjoshicodes wants to merge 1 commit into
Conversation
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.
Problem
ChatMessageinsrc/models/message.rshas nosubjectfield, so the subject of a channel root message — which Graph returns on bothGET .../messages/{id}and the list endpoint — is silently dropped during deserialization. A message posted with a subject reads back without one:There was also no way to set a subject on send.
Change
ChatMessagegainssubject: Option<String>(skip-serializing when absent, so messages without a subject gain no"subject": nullnoise).message getandmessage listnow return what Graph stores.SendMessageRequestgains the top-levelsubject, exposed asteams message send --subject TEXT. Channel sends only: chat messages have no subject, so clap rejects--subjectwith--chator without--channel(exit 2) before anything is sent.docs/command-reference.md,docs/man/teams.1, CHANGELOG entry under Unreleased. No version bump (per the release-automation convention).Tests
SendMessageRequestserializessubjectat the top level.message send --helpadvertises--subject <SUBJECT>;--subjectwith--chatand--subjectwithout--channelboth fail with exit 2.cargo fmt -- --check,cargo clippy --all-targets --all-features -- -D warnings,cargo test --all-targets(313 tests) all green.Live verification (real tenant, delegated auth)
Send with the patched binary, then read back three ways:
message liston the same channel shows the subject on the patched binary as well.