fix: avatar update not reflecting in ProfileView and SidebarView - #7430
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📜 Recent review details⏰ Context from checks skipped due to timeout. (2)
🧰 Additional context used📓 Path-based instructions (5)**/*.{js,ts,jsx,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.{ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.{js,jsx,ts,tsx,json}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/*.{js,jsx,ts,tsx}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
app/lib/services/connect.ts📄 CodeRabbit inference engine (CLAUDE.md)
Files:
🧠 Learnings (1)📚 Learning: 2026-04-30T17:07:51.020ZApplied to files:
🔇 Additional comments (2)
WalkthroughThe ChangesAvatar ETag Redux Dispatch
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Caution Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted. Error details |
|
Caution Review failedAn error occurred during the review process. Please try again later. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Proposed changes
When the logged-in user changes their avatar, the updateAvatar event from stream-notify-logged only updated the WatermelonDB users record. The logged-user record observed by useAvatarETag was never refreshed, so the avatar stayed stale in ProfileView, SidebarView, etc. until a reconnect.
This change dispatches setUser({ avatarETag }) when the updateAvatar event belongs to the logged user, pushing the new etag through Redux so the avatar updates immediately across the app. The existing users-DB update is preserved.
Added unit tests in connect.test.ts covering the new behavior: dispatch for the logged user, no dispatch for other users or when no user is logged in, and that the DB record is still updated.
Issue(s)
https://rocketchat.atlassian.net/browse/NATIVE-1171
How to test or reproduce
Screenshots
Types of changes
Checklist
Further comments
Summary by CodeRabbit