feat(avatar): add real avatars - #161
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Unused avatar load cache
- Removed unused loadedAvatarUrls Set and its onLoad handler, updated comment to accurately reflect that only failed URLs are cached
You can send follow-ups to the cloud agent here.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b5ad4e0. Configure here.
| onError={() => { | ||
| failedAvatarUrls.add(avatarUrl!); | ||
| forceRender(); | ||
| }} |
There was a problem hiding this comment.
Bug: When an avatar image fails, only the specific component instance re-renders. Other Avatar components using the same failed URL will continue to show a broken image.
Severity: LOW
Suggested Fix
To ensure all Avatar components update when an image URL fails, implement a mechanism to notify all instances. For example, use a shared state or an event emitter. When an image fails, broadcast an event that all mounted Avatar components subscribe to, causing them to call forceRender() and display the fallback consistently.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: src/app/components/Avatar.tsx#L32-L35
Potential issue: When an avatar image fails to load, the `onError` handler adds the
failed URL to the module-level `failedAvatarUrls` set but only triggers a re-render for
the specific component instance where the error occurred. If other `Avatar` components
are mounted and displaying the same `avatarUrl`, they will not be notified of the
failure. Consequently, their rendering logic, which checks `failedAvatarUrls`, will not
be re-evaluated, and they will continue to display a broken image icon instead of the
intended fallback.
Did we get this right? 👍 / 👎 to inform future reviews.

Currently, the UI shows the same plain initials for every user. The
avatar_urlis already stored, we just hadn't surfaced it.This PR adds a new
Avatarcomponent which falls back to the existing initials implemention.