Skip to content

feat(teams): dispatch bot join events - #899

Merged
bensabic merged 4 commits into
mainfrom
josh/teams-joins
Sep 5, 2026
Merged

feat(teams): dispatch bot join events#899
bensabic merged 4 commits into
mainfrom
josh/teams-joins

Conversation

@dancer

@dancer dancer commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

summary

  • dispatch onMemberJoinedChannel when the bot joins a Teams channel or group chat
  • expose botUserId from the configured app identity
  • preserve channel routing, inviter identity, and webhook waitUntil tracking
  • add regression tests and document the bot-only scope

addresses the bot-join portion of #847; personal install/uninstall hooks remain separate

@dancer
dancer requested a review from a team as a code owner September 4, 2026 18:32
@vercel

vercel Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
chat Ready Ready Preview, v0 Sep 5, 2026 5:18am UTC
chat-sdk-nextjs-chat Ready Ready Preview, v0 Sep 5, 2026 5:18am UTC

Match the bot against the platform-supplied recipient id and compare
app ids case-insensitively, so joins are recognised regardless of the
GUID casing in configuration. Fall back to the 19: prefix when Teams
omits the conversation type, warn when the chat instance or app id is
missing, and log the skip reason for everything else at debug level.

Seed Graph channel context from team-install payloads, which carry the
team aadGroupId but no channelData.channel, so welcome handlers can
fetch messages on the joined channel. Encode the join thread id
directly instead of round-tripping through channelIdFromThreadId.

Tests drive a join end to end through handleWebhook to cover the
webhook options bridge, and add cases for casing, unresolved
conversation types, the misconfiguration warning, and the cache seed.

Signed-off-by: Ben Sabic <bensabic@users.noreply.github.com>
The handling-events page described the event as Slack-only. Note that
Teams also emits it, only when the bot itself is added, and update the
property table accordingly.

Signed-off-by: Ben Sabic <bensabic@users.noreply.github.com>
@bensabic
bensabic enabled auto-merge (squash) September 5, 2026 05:18
@bensabic
bensabic merged commit aaeede7 into main Sep 5, 2026
19 checks passed
@bensabic
bensabic deleted the josh/teams-joins branch September 5, 2026 05:21
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.

2 participants