Skip to content

[Docs] Add cancellationToken to all C# handler examples#2735

Merged
rido-min merged 1 commit into
mainfrom
rido/update-dotnet-ct
Apr 3, 2026
Merged

[Docs] Add cancellationToken to all C# handler examples#2735
rido-min merged 1 commit into
mainfrom
rido/update-dotnet-ct

Conversation

@rido-min

@rido-min rido-min commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds cancellationToken parameter to all C# handler lambda signatures across 18 doc include files
  • Passes cancellationToken to all async SDK calls (Send, Typing, SignIn, SignOut, SendAsync)
  • Covers essentials, getting-started, in-depth-guides (AI, adaptive cards, meeting events, user auth), and migration docs

Test plan

  • npm run generate:docs succeeds with 0 content gaps
  • Grep confirms no remaining async handlers without cancellationToken in generated docs
  • Visual review of rendered docs

🤖 Generated with Claude Code

All C# doc examples now consistently pass cancellationToken through
handler lambdas and into async SDK calls (Send, Typing, SignIn, etc.),
matching the pattern established in the sending-messages docs.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@rido-min
rido-min requested a review from corinagum April 3, 2026 01:22
@rido-min
rido-min merged commit f393932 into main Apr 3, 2026
2 checks passed
@rido-min
rido-min deleted the rido/update-dotnet-ct branch April 3, 2026 16:50
corinagum added a commit that referenced this pull request May 8, 2026
Per project convention (#2735), C# handler lambdas take
(context, cancellationToken) and thread the token through Send,
Task.Delay, and SDK calls. The reactions guide didn't follow this.

Uses named-arg form (cancellationToken: cancellationToken) for the
reaction API calls because AddAsync / DeleteAsync have an optional
AgenticIdentity parameter sitting between reactionType and the token.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
corinagum added a commit that referenced this pull request May 11, 2026
Per project convention (#2735), C# handler lambdas take
(context, cancellationToken) and thread the token through Send,
Task.Delay, and SDK calls. The reactions guide didn't follow this.

Uses named-arg form (cancellationToken: cancellationToken) for the
reaction API calls because AddAsync / DeleteAsync have an optional
AgenticIdentity parameter sitting between reactionType and the token.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
corinagum added a commit that referenced this pull request May 13, 2026
Per project convention (#2735), C# handler lambdas take
(context, cancellationToken) and thread the token through Send,
Task.Delay, and SDK calls. The reactions guide didn't follow this.

Uses named-arg form (cancellationToken: cancellationToken) for the
reaction API calls because AddAsync / DeleteAsync have an optional
AgenticIdentity parameter sitting between reactionType and the token.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
corinagum added a commit that referenced this pull request May 14, 2026
Per project convention (#2735), C# handler lambdas take
(context, cancellationToken) and thread the token through Send,
Task.Delay, and SDK calls. The reactions guide didn't follow this.

Uses named-arg form (cancellationToken: cancellationToken) for the
reaction API calls because AddAsync / DeleteAsync have an optional
AgenticIdentity parameter sitting between reactionType and the token.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
corinagum added a commit that referenced this pull request May 14, 2026
## Summary

Adds an in-depth guide for message reactions covering outbound
add/remove and inbound `messageReaction` handling, plus links the
existing "Reactions" section in the Sending Messages essentials page to
the new guide.

## What's covered in the guide

- Public-developer-preview banner
- Adding and removing reactions (`api.reactions.add` /
`api.reactions.delete` / `Reactions.AddAsync` / `Reactions.DeleteAsync`)
- Receiving reactions: `messageReaction` activity handlers across all
three SDKs, plus the .NET-only `OnMessageReactionAdded` /
`OnMessageReactionRemoved` sub-handlers
- Available reaction types — the modern set of 6 (`like`, `heart`,
`1f440_eyes`, `2705_whiteheavycheckmark`, `launch`, `1f4cc_pushpin`)
- Skin tone variants (`-tone1` … `-tone5`)
- Rate limits (2 reactions/sec, 429 + Retry-After)
- Best practices and differences from Feedback

## What's intentionally omitted

- **Custom reactions section** — aligned with the Microsoft Learn agent
reactions PR
([msteams-docs#13991](MicrosoftDocs/msteams-docs#13991)),
which is omitting custom reaction examples due to a known client-side
rendering issue. A commented-out link to the Learn reactions reference
remains in the source for restoration once that PR lands.
- **Advanced API client usage** — the previous draft's example
referenced an `ApiClient` constructor that doesn't exist in the current
SDK; removed rather than rewritten.

## Coordination

- C# samples follow the project convention from #2735 (cancellationToken
in handler signatures, threaded through `Send`, `Task.Delay`, and
reaction API calls).
- The TypeScript include uses `api.reactions.delete()` ahead of
[microsoft/teams.ts#567](microsoft/teams.ts#567),
which renames `remove()` → `delete()` to align with teams.py and
teams.net.

## Test plan

- [x] `npm start` regenerates docs cleanly with no content gaps
- [x] Per-language renders (TS / Python / C#) verified in the dev server
- [x] Cross-link from `essentials/sending-messages` → in-depth guide
resolves correctly
- [ ] Visual review on the deployed preview

---------

Co-authored-by: Corina Gum <[email protected]>
Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
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.

2 participants