microsoft / microsoft/teams.ts
Remove outdated rejection of targeted messages in 1:1 chats
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 107
- Forks
- 39
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 74
Description
## Description
`@microsoft/teams.apps` rejects targeted messages in personal chats with:
```
Targeted messages are not supported in 1:1 (personal) chats.
```
Teams does support targeted messages in 1:1 chats, so this validation is out of date and prevents otherwise valid sends.
## Reproduction
Using `@microsoft/teams.apps@2.0.15`:
1. Handle an inbound activity in a conversation whose `conversationType` is `personal` and whose recipient has `isTargeted: true`.
2. Call `ActivityContext.send()` with an ordinary message that has no explicit recipient.
3. `ActivityContext.shouldOutboundBeAutoTargeted()` applies the initiating user as the targeted recipient.
4. `ActivitySender.send()` detects both `recipient.isTargeted === true` and `conversationType === 'personal'`, then throws before calling the conversations API.
The relevant guard is in `packages/apps/src/activity-sender.ts`:
```ts
if (isTargeted && ref.conversation.conversationType === 'personal') {
throw new Error('Targeted messages are not supported in 1:1 (personal) chats.');
}
```
## Expected behavior
The SDK should send the targeted activity in a 1:1 conversation through the targeted activity API, just as it does for other supported conversation types.
## Actual behavior
The SDK throws locally and never attempts the API request.
## Additional context
This can also happen unexpectedly when application code sends an ordinary message: the SDK's inbound-target propagation adds `isTargeted: true`, after which `ActivitySender` rejects the resulting personal-chat message. Removing the outdated personal-chat guard should allow the existing targeted create/update path to handle it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in packages/apps/src/activity-sender.ts at the guard that rejects targeted messages when conversationType is personal, then trace the existing targeted create/update path used for other conversation types. Verify that a targeted activity in a personal conversation reaches the conversations API instead of throwing locally, including the inbound-target propagation case described in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100