Skip to content

[onTurnError] unhandled error for informative streaming #4902

@shreyamdg

Description

@shreyamdg

Versions

  • SDK: botbuilder 4.23.2 (works) / 4.23.3 (broken)
  • Node.js: 18.x
  • Browser/Client: Chrome, Microsoft Teams App
  • OS: macOS

Describe the bug

Our scenario:

  • When a user asks a question, we first send a Typing activity with text “Accessing Joule…” to indicate that work has begun.

  • We then call downstream services over Kafka, which respond with a series of status updates which is our way of showing interim states which produces messages like for example:

    • “Searching for flights…”
    • “Finding best prices for you…”
    • “Finding the best deals…”
  • These are sent back to Teams as informative streaming updates (Typing activities with streaminfo.streamType = informative) so that the user sees ephemeral status lines while work continues.

  • Finally, when the backend completes, we send a Message activity with the final result.

Issue

After upgrading from botbuilder 4.23.2 to 4.23.3, our Teams bot(and CEA) starts throwing the following error whenever sending the initial streaming/typing activity:

[onTurnError] unhandled error: RestError: Only start streaming and continue streaming types are allowed as a typing activity

The exact same code runs without error on 4.23.2.

It looks like 4.23.3 introduced stricter validation around Typing activities with streaminfo entities. Our bot sends an initial status update (e.g., “Accessing Joule…”) as a typing activity with:

private async streamBeginMessage(context: TurnContext) {
    const streamingActivityFirst ={
      type: ActivityTypes.Typing,
      text: i18n(context.activity.locale?.toLowerCase()).accessingJoule, // "Accessing Joule…"
      entities: [{
        type: 'streaminfo',
        streamType: 'informative',
        streamSequence: 1
      }]
    }
    const initialStream = await context.sendActivity(streamingActivityFirst);
    // @ts-ignore
    return initialStream.id;
  }

This was valid in 4.23.2 but now causes the above RestError in 4.23.3.

To Reproduce

We are building an enterprise bot and cannot share the full source code for replication. However, the problem occurs consistently when sending a Typing activity with a streaminfo entity (streamType: informative, streamSequence: 1) after upgrading to 4.23.3. The same activity succeeds without error on 4.23.2.

Expected behavior

The activity should be accepted, as it is valid according to the Teams streaming bot documentation. The same payload works fine with botbuilder 4.23.2.

Screenshots / Logs

N/A – error reproduced consistently with the above payload.

Additional context

  • Downgrading back to 4.23.2 immediately resolves the issue.
  • It appears that new validation logic in 4.23.3 is rejecting informative/streaming on Typing activities even though these are supported in Teams.
  • This is blocking bots that rely on ephemeral informative status updates before the final message.

Metadata

Metadata

Assignees

Labels

bugIndicates an unexpected problem or an unintended behavior.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions