Skip to content

Add setCachePolicy card action type - #663

Merged
Mehak Bindra (MehakBindra) merged 1 commit into
mainfrom
mehakbindra-add-cache-policy-action
Aug 29, 2026
Merged

Add setCachePolicy card action type#663
Mehak Bindra (MehakBindra) merged 1 commit into
mainfrom
mehakbindra-add-cache-policy-action

Conversation

@MehakBindra

@MehakBindra Mehak Bindra (MehakBindra) commented Aug 28, 2026

Copy link
Copy Markdown
Member

Summary

  • add the Teams setCachePolicy card/suggested-action type to the .NET action model
  • document the {"type":"no-cache"} value used to disable caching for link-unfurling responses
  • preserve the existing action types, including the newer experimental Action.Submit type

Cross-SDK context: microsoft/teams.ts#574
Related issue: microsoft/teams.ts#154

Tests

  • dotnet format Microsoft.Teams.slnx --include src/Microsoft.Teams.Apps/Schema/SuggestedAction.cs test/Microsoft.Teams.Apps.UnitTests/SuggestedActionsTests.cs --verify-no-changes
  • dotnet test test/Microsoft.Teams.Apps.UnitTests/Microsoft.Teams.Apps.UnitTests.csproj --framework net8.0 --filter FullyQualifiedName~SuggestedActionsTests --no-restore (15 passed)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings August 28, 2026 22:58
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for Teams setCachePolicy as a first-class suggested-action/card action type in the .NET schema model, including documentation for the "no-cache" value used to disable caching for link-unfurling responses.

Changes:

  • Introduced ActionType.SetCachePolicy and ActionTypes.SetCachePolicy constants ("setCachePolicy") with XML doc guidance for the {"type":"no-cache"} value.
  • Extended unit tests to validate the new constant value and to round-trip a setCachePolicy suggested action carrying the "no-cache" payload.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/Microsoft.Teams.Apps/Schema/SuggestedAction.cs Adds SetCachePolicy action type constant and documents the "no-cache" payload used for link-unfurling caching control.
test/Microsoft.Teams.Apps.UnitTests/SuggestedActionsTests.cs Adds assertions for the new constant and a JSON round-trip test covering the {"type":"no-cache"} value shape.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@MehakBindra
Mehak Bindra (MehakBindra) added this pull request to the merge queue Aug 29, 2026
Merged via the queue into main with commit 72fb30e Aug 29, 2026
7 checks passed
@MehakBindra
Mehak Bindra (MehakBindra) deleted the mehakbindra-add-cache-policy-action branch August 29, 2026 01:02
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.

[api] add type 'setCachePolicy' in CardAction

3 participants