Skip to content

fix(teams): hydrate incoming author email#711

Merged
bensabic merged 4 commits into
vercel:mainfrom
onmax:agent/teams-author-email
Jul 15, 2026
Merged

fix(teams): hydrate incoming author email#711
bensabic merged 4 commits into
vercel:mainfrom
onmax:agent/teams-author-email

Conversation

@onmax

@onmax onmax commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds optional email to normalized message authors and preserves it through message serialization.

For incoming Teams messages, resolves the sender with the activity's Entra object ID before dispatch, falling back to the cached ID when the activity omits it. The lookup reuses the existing mail ?? userPrincipalName mapping from #708, and missing permissions or Graph failures leave email undefined without blocking message delivery.

This deliberately revisits the author-profile boundary discussed in #239: the core field is optional, and Teams populates it only when Microsoft Graph can resolve the sender.

Test plan

  • pnpm --filter chat exec vitest run src/message.test.ts
  • pnpm --filter @chat-adapter/teams exec vitest run src/index.test.ts
  • Chat and Teams package typechecks and builds
  • TURBO_CONCURRENCY=2 pnpm validate

Checklist

  • All commits are signed and verified
  • All commits are signed off for the DCO (git commit -s)
  • pnpm validate passes
  • Changeset added (or N/A — see CONTRIBUTING.md)
  • Documentation updated (or N/A)

Signed-off-by: onmax <maximogarciamtnez@gmail.com>
@onmax onmax requested a review from a team as a code owner July 15, 2026 03:24
@vercel

vercel Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

@onmax is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

onmax and others added 3 commits July 15, 2026 10:36
Signed-off-by: onmax <maximogarciamtnez@gmail.com>
- Distinct warn message for state-read vs Graph failures
- Clarify README that email hydration covers live incoming messages only
- Bump changeset to minor (new public Author field)
- Add DM-path test covering the stream-keepalive branch

Signed-off-by: Ben Sabic <bensabic@users.noreply.github.com>
Resolved profiles are cached for 1 hour keyed by AAD object ID, and
failed lookups for 5 minutes, so email hydration doesn't add a Graph
round-trip to every incoming message and tenants without Graph consent
don't pay a failing call (plus a warn log) per message.

Signed-off-by: Ben Sabic <bensabic@users.noreply.github.com>
@bensabic bensabic merged commit 46681f5 into vercel:main Jul 15, 2026
12 of 14 checks passed
@onmax onmax deleted the agent/teams-author-email branch July 15, 2026 04:40
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