Hydrate dashboard creator emails from Supabase auth#334
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryMedium Risk Overview Reviewed by Cursor Bugbot for commit 5077f02. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Pull request overview
Adds a fallback path that resolves missing creator emails on API key and template lists by querying the Supabase auth_users view, in preparation for the Infra API deprecating creator email fields.
Changes:
- New
auth-user-emails.server.tsmodule withgetAuthUserEmailsById(queries Supabase admin) and a genericresolveMissingCreatorEmailshelper that hydratescreatedBy.emailonly for items missing one, silently falling back to original data on lookup failure. - Keys and templates repositories accept an injectable
resolveAuthUserEmailsByIddep and useresolveMissingCreatorEmailson list/create results;createApiKeyalso guards against a missingres.data. - New unit test covering
listTeamApiKeyshydration and graceful degradation when the lookup throws.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/core/modules/users/auth-user-emails.server.ts | New helper to batch-fetch auth emails and hydrate missing createdBy.email fields |
| src/core/modules/keys/repository.server.ts | Wires hydration into listTeamApiKeys/createApiKey and adds a null-data guard |
| src/core/modules/templates/repository.server.ts | Wires hydration into template listing |
| tests/unit/keys-repository.test.ts | New tests covering hydration and lookup-failure fallback |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit fb3c547. Configure here.
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

Motivation
Infra API creator email fields are being deprecated as
public.usersmoves away from storing profile data. Dashboard keeps creator email display working by falling back to Supabase Auth only when the API response does not include an email.Made with Cursor