Skip to content

feat(api): add setCachePolicy to CardActionType#574

Open
Copilot wants to merge 2 commits into
mainfrom
copilot/add-set-cache-policy
Open

feat(api): add setCachePolicy to CardActionType#574
Copilot wants to merge 2 commits into
mainfrom
copilot/add-set-cache-policy

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 14, 2026

setCachePolicy was missing from the CardActionType union, making it impossible to disable Teams' default 30-minute link unfurling cache in a type-safe way.

Changes

  • packages/api/src/models/card/card-action.ts
    • Added 'setCachePolicy' to the CardActionType union
    • Corrected the JSDoc on CardAction.type to match the actual union members (removed stale messageBack/openApp entries that were never in the type)

Usage

suggestedActions: {
  actions: [
    {
      type: 'setCachePolicy',          // previously a type error
      title: '',
      value: '{"type":"no-cache"}'
    }
  ]
}

See Teams link unfurling cache docs for context.

Agent-Logs-Url: https://github.com/microsoft/teams.ts/sessions/eb5da128-983d-4e3e-b0e3-0c1c4415863c

Co-authored-by: heyitsaamir <48929123+heyitsaamir@users.noreply.github.com>
Copilot AI changed the title [WIP] Add type 'setCachePolicy' in CardAction feat(api): add setCachePolicy to CardActionType May 14, 2026
Copilot AI requested a review from heyitsaamir May 14, 2026 18:39
@heyitsaamir heyitsaamir marked this pull request as ready for review May 14, 2026 20:45
Copilot AI review requested due to automatic review settings May 14, 2026 20:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds missing setCachePolicy to the CardActionType union so consumers can disable Teams’ default link unfurling cache in a type-safe way, and aligns the CardAction.type JSDoc with the actual allowed values.

Changes:

  • Added 'setCachePolicy' to CardActionType
  • Updated CardAction.type JSDoc to remove stale values and include setCachePolicy

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 15 to 19
/**
* The type of action implemented by this button. Possible values include: 'openUrl', 'imBack',
* 'postBack', 'playAudio', 'playVideo', 'showImage', 'downloadFile', 'signin', 'call',
* messageBack', 'openApp', 'invoke'
* 'invoke', 'setCachePolicy'
*/
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