Conversation
Add Gravatar fallback for users who sign up via email/password and don't have an OAuth-provided avatar. The avatar URL is resolved server-side in layout.tsx using SHA-256 hashing to avoid unnecessary client-side effects, and passed through props to UserMenu. For CurrentUserAvatar (chat messages), the Gravatar fallback is computed within the existing async useEffect in the hook. Closes #820
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 45d3d52a8f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Align use-current-user-image hook with layout.tsx by also checking user_metadata.picture before falling back to Gravatar. Ensures consistent avatar resolution across all surfaces.
|
Closing this PR after further analysis of the privacy trade-off. While Gravatar integration works correctly, exposing email hashes for all email/password users to benefit only the small subset who have Gravatar accounts is not a favorable trade-off. The existing initials-based fallback provides sufficient UX without any privacy cost. See #820 for further discussion. |
Summary
layout.tsxusing SHA-256 hashing and passed via props toUserMenu, avoiding client-sideuseEffectCurrentUserAvatar(chat messages), Gravatar fallback is computed within the existing async hook?d=404)Closes #820
Privacy note
Gravatar URLs contain a SHA-256 hash of the user's email address. While not directly reversible, the hash can be matched against known email lists to identify the original address. This is a common trade-off shared by services that use Gravatar (e.g. Stack Overflow, WordPress). The hash is exposed in the browser's network requests and rendered HTML for email/password users only — OAuth users are unaffected as their provider avatar takes precedence.
Changes
lib/utils/gravatar.server.tslib/utils/gravatar.tsapp/layout.tsxavatarUrlserver-side and pass through propscomponents/header.tsxavatarUrlprop toUserMenucomponents/user-menu.tsxavatarUrlprop directly (no useEffect)hooks/use-current-user-image.tslib/utils/__tests__/gravatar.test.tsTest plan