fix: preserve chatMessage subject on reads and add message send --subject - #90
Merged
Merged
Conversation
Contributor
|
Reviewed and verified locally:
Extended the branch with one commit (from @aberoham's follow-up) so the fix reaches every output format, not just JSON: the human table gains a Subject column, and the plain TSV list now collects columns across all rows, so a subject that first appears on a later row is no longer dropped by the first-row header derivation. Tests cover both. Merging once CI is green. |
sionsmith
added a commit
to amanjoshicodes/ms-teams-cli
that referenced
this pull request
Sep 6, 2026
Windows gives the main thread 1 MiB; Linux and macOS give it 8 MiB. Building clap's command tree for this many subcommands needs just under 1 MiB in an unoptimized build (measured with `ulimit -s` on 2026-09-06: main fails below 1024 KiB on macOS too), so adding a single flag to `message` (osodevops#90, osodevops#91) made every debug and test invocation on Windows, `--help` included, die with `thread 'main' has overflowed its stack`, and `cargo test --all-targets` failed on windows-latest only. A build script now passes `/STACK:8388608` to the MSVC linker (and `--stack` to the GNU one). This is the approach rustup takes for the same clap behaviour (clap-rs/clap#5134), and unlike a `.cargo/config` rustflags entry it survives CI setting `RUSTFLAGS`. The reservation is address space, not committed memory. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WG7vFLjFZHqAUMRS1zkWRE
sionsmith
force-pushed
the
fix/message-subject
branch
from
September 6, 2026 05:57
716490f to
9a3bc38
Compare
sionsmith
added a commit
that referenced
this pull request
Sep 6, 2026
Windows gives the main thread 1 MiB; Linux and macOS give it 8 MiB. Building clap's command tree for this many subcommands needs just under 1 MiB in an unoptimized build (measured with `ulimit -s` on 2026-09-06: main fails below 1024 KiB on macOS too), so adding a single flag to `message` (#90, #91) made every debug and test invocation on Windows, `--help` included, die with `thread 'main' has overflowed its stack`, and `cargo test --all-targets` failed on windows-latest only. A build script now passes `/STACK:8388608` to the MSVC linker (and `--stack` to the GNU one). This is the approach rustup takes for the same clap behaviour (clap-rs/clap#5134), and unlike a `.cargo/config` rustflags entry it survives CI setting `RUSTFLAGS`. The reservation is address space, not committed memory. Claude-Session: https://claude.ai/code/session_01WG7vFLjFZHqAUMRS1zkWRE Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
sionsmith
force-pushed
the
fix/message-subject
branch
from
September 6, 2026 06:00
9a3bc38 to
cb53414
Compare
This was referenced Sep 6, 2026
Merged
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.