Skip to content

Conversation

@evanhutnik
Copy link
Contributor

@evanhutnik evanhutnik commented Dec 4, 2025

Summary

Adding new endpoint to auth service, POST /users/get_names_with_emails.

Similar to the existing POST /users/get_names endpoint, this one queries for the names for user_ids passed to it. The difference is if the user has not joined Macro or set a name in Macro, it falls back to checking for a name from the user's email contacts.

I added this as a separate endpoint, as the existing /get_names endpoint doesn't require authentication, but this one does (as we are using the authenticated user's email contacts). Also, there are use cases where we ONLY want the names from the Macro users. For example, the Get Channels endpoint uses /get_names to get the names for participants of a Macro channel. We don't want to include email contact names in this case as it would result in a mismatch between what that endpoint would return and what they would see when actually interacting with the user in Macro.

Email names are a single name column, so we do a (Peter approved) best-effort approach for splitting into first and last name, where we set first_name to the first word in the contact name, and last_name to the rest of it.

Screenshots, GIFs, and Videos

@evanhutnik evanhutnik requested a review from a team as a code owner December 4, 2025 22:24
@linear
Copy link

linear bot commented Dec 4, 2025

operation_id = "get_user_names_with_email",
responses(
(status = 200, body=UserNames),
(status = 401, body=String),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing 400 for user ids being empty

@evanhutnik evanhutnik merged commit 1106cf2 into main Dec 5, 2025
36 checks passed
@evanhutnik evanhutnik deleted the evan/bac-138-update-user-preview-call-in-auth-service-to-coalesce-on branch December 5, 2025 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants