fix(teams): hydrate incoming author email#711
Merged
Conversation
Signed-off-by: onmax <maximogarciamtnez@gmail.com>
Contributor
|
@onmax is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
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
approved these changes
Jul 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 ?? userPrincipalNamemapping 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.tspnpm --filter @chat-adapter/teams exec vitest run src/index.test.tsTURBO_CONCURRENCY=2 pnpm validateChecklist
git commit -s)pnpm validatepasses