Skip to content

feat(gchat): expose sender email on message authors and action users - #1136

Merged
bensabic merged 3 commits into
vercel:mainfrom
Swahjak:feat/gchat-author-email
Nov 12, 2026
Merged

bensabic merged 3 commits into
vercel:mainfrom
Swahjak:feat/gchat-author-email

Conversation

@Swahjak

@Swahjak Swahjak commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1134

Google Chat webhook events carry the sender's email address, but the adapter never filled the optional email field on message authors or action users. This sets message.author.email from sender.email on webhook messages and event.user.email from the clicking user's email on card button clicks. An empty or missing email leaves the field undefined.

Pub/Sub messages, reactions, and fetchMessages results come from the Chat API, whose user resource has no email field. The adapter already caches each webhook sender's email, so those paths now read it from the cache alongside the display name. The field is set once the user has sent a webhook message that included an email, and is undefined until then. A state read failure also leaves it undefined without failing the message, fetch, or reaction.

The user cache changes to support this. Writes from webhook messages merge with the stored entry, so a later event without an email, avatar, or bot flag keeps them. A display name seen only on a Pub/Sub or fetchMessages payload creates the stored entry when the user has none and no longer replaces one, which means getUser can return an older display name until the user's next webhook message. The docs page gets a "User email addresses" section covering this, and the changeset is minor. pnpm validate passes.

Google Chat webhook events carry the sender's email address, and the Author and ActionEvent user types already have an optional email field, but the adapter never filled it. Set author.email on incoming messages from sender.email and user.email on card clicks from the clicking user's email. An empty or missing email leaves the field undefined.

Signed-off-by: Peep van Puijenbroek <4386577+Swahjak@users.noreply.github.com>
@Swahjak
Swahjak requested a review from a team November 10, 2026 15:41
@vercel

vercel Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

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

A member of the Team first needs to authorize it.

…ons, and fetchMessages

Pub/Sub messages, reactions, and fetchMessages results come from the Chat API, whose user resource has no email. The adapter already caches the sender's email from webhook messages, so these paths now read it from that cache alongside the display name. A Pub/Sub payload that carries an email takes precedence, and a failed state read leaves the email undefined without failing the message, fetch, or reaction.

The user cache now merges on write, so a later event without an email, avatar, or bot flag keeps the stored values, and an empty email is treated as missing. A cached entry without an email is checked against the state adapter on lookup, which picks up an email stored by another instance, and concurrent lookups for one user share a single read. A display name seen only on a Pub/Sub or fetchMessages payload creates the stored entry when none exists and no longer replaces one.

The docs section and changeset describe the cache fallback and when the email can be undefined.

Signed-off-by: Ben Sabic <bensabic@users.noreply.github.com>
The Microsoft SDK looks up a user token for each activity it processes. TestTeamsAdapter only stubbed that lookup in stubOutbound and spyActivitySender, so tests that drove the SDK through allowUnauthenticatedWebhooks or receive alone waited on it, and the inbound markdown budget tests could exceed the 5 second test timeout.

allowUnauthenticatedWebhooks and receive now apply the stub as well, which keeps those tests off the lookup.

Signed-off-by: Ben Sabic <bensabic@users.noreply.github.com>
@bensabic
bensabic enabled auto-merge (squash) November 12, 2026 08:50
@bensabic
bensabic merged commit e521714 into vercel:main Nov 12, 2026
23 of 24 checks passed
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.

feat(gchat): populate author.email and action user email

2 participants