microsoft / microsoft/teams.py

[Bug]: ctx.stream.close() returns placeholder activity ID

Open Beginner friendly
#592 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
65
Forks
30
Avg merge
1d 4h
Merged PRs (30d)
23

Description

### Bug Description

`await ctx.stream.close()` returns a `SentActivity` whose `id` is
`DO_NOT_USE_PLACEHOLDER_ID` instead of the ID of the streamed activity.

Teams returns the stream/activity ID from the initial streaming request. Later streaming requests, including the final request, return an empty successful response. The SDK currently maps the empty response to its placeholder ID and returns that value from `HttpStream.close()`, even though the stream has stored the actual ID from the initial request.

### Steps to Reproduce

1. Emit content through `ctx.stream.emit()`.
2. Await the activity with `ctx.stream.close()`.
3. Observe that `result.id` is `DO_NOT_USE_PLACEHOLDER_ID`.

### Expected Behavior

`ctx.stream.close()` should return a `SentActivity` with the original stream ID, or at least not the `DO_NOT_USE_PLACEHOLDER_ID` value.

### Actual Behavior

`ctx.stream.close()` returns a `SentActivity` set to `DO_NOT_USE_PLACEHOLDER_ID`.

### SDK Version

v2.0.0a31

### Python Version

3.12.10

### Additional Context

_No response_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the HttpStream.close() entry point and trace how the stored stream ID and the empty final response are mapped into the returned SentActivity. Reproduce the issue with ctx.stream.emit() followed by ctx.stream.close(), then verify that the result uses the original stream ID rather than DO_NOT_USE_PLACEHOLDER_ID.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.