Skip to content

iPhone composeExtension/fetchTask invoke omits commandContext and breaks Microsoft.Teams SDK deserialization #2404

Description

@gauravsarwal

Bug report

When opening a Teams message extension action command from iPhone, the invoke payload can omit value.commandContext.

With:

  • Microsoft.Teams.Plugins.AspNetCore 2.0.9
  • Microsoft.Teams.Extensions.Graph 2.0.9

the request fails during deserialization before app handlers run.

Actual behavior

The SDK throws:

System.Text.Json.JsonException: JSON deserialization for type 'Microsoft.Teams.Api.MessageExtensions.Action' was missing required properties including: 'commandContext'.

This happens in Microsoft.Teams.Plugins.AspNetCore.AspNetCorePlugin.ParseActivity(...).

Expected behavior

Either:

  • Teams mobile should always send commandContext, or
  • the SDK should treat commandContext as optional for this invoke shape

Repro

  1. Create a compose extension command with:
    • type: action
    • fetchTask: true
  2. Open it from Teams web/desktop → works
  3. Open the same command from Teams on iPhone → request may omit value.commandContext
  4. SDK deserialization fails before handler execution

Working payload example

{ "name": "composeExtension/fetchTask", "value": { "commandId": "createTicket", "commandContext": "compose", "context": { "theme": "default" } } }

Failing payload example

{ "name": "composeExtension/fetchTask", "value": { "commandId": "createTicket", "context": { "theme": "dark" }, "state": "" } }

Workaround

Application-side middleware was required to inject a fallback commandContext before SDK deserialization.

Question

Is this a known Teams iPhone client issue, or should the SDK tolerate missing commandContext here?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions