-
Notifications
You must be signed in to change notification settings - Fork 373
fix(llc): Use extraData for name in ConnectUserDetails #2451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughChanged user-name sourcing for WebSocket connect to use Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant ConnectUserDetails
participant WebSocket
Note over ConnectUserDetails: Name selection logic (changed)
Client->>ConnectUserDetails: build from OwnUser
ConnectUserDetails-->ConnectUserDetails: name = extraData['name'].safeCast<String>()\n(or null)
ConnectUserDetails->>WebSocket: connect(payload with name)
WebSocket->>Client: connection established
sequenceDiagram
participant ThumbnailWidget
participant RemoteLoader
Note over ThumbnailWidget: imageUrl = thumbUrl ?? imageUrl ?? assetUrl (new unified path)
ThumbnailWidget->>ThumbnailWidget: compute imageUrl
alt imageUrl != null
ThumbnailWidget->>RemoteLoader: request resized remote image
RemoteLoader-->ThumbnailWidget: image bytes
else
ThumbnailWidget-->ThumbnailWidget: render local asset or placeholder
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
packages/stream_chat/CHANGELOG.md(1 hunks)packages/stream_chat/lib/src/ws/connect_user_details.dart(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
- GitHub Check: stream_chat_flutter
- GitHub Check: stream_chat_localizations
- GitHub Check: stream_chat_flutter_core
- GitHub Check: stream_chat_persistence
- GitHub Check: build (ios)
- GitHub Check: test
- GitHub Check: analyze
- GitHub Check: analyze_legacy_versions
🔇 Additional comments (2)
packages/stream_chat/CHANGELOG.md (1)
1-6: LGTM!The CHANGELOG entry accurately documents the fix and properly references issue #2447. The description clearly explains what was fixed.
packages/stream_chat/lib/src/ws/connect_user_details.dart (1)
39-40: Synchronization betweenuser.nameanduser.extraData['name']is properly maintained.Verification confirms the User and OwnUser models correctly synchronize these fields:
- The User constructor automatically sets
nameinextraDatawith key 'name' when provided- The
namegetter reads fromextraData['name']and falls back toidonly if the value is null or empty- The
copyWithmethod properly preserves name synchronization- OwnUser's
copyWithuses the same synchronization pattern- OwnUser's
mergemethod explicitly usesextraData['name']The fix correctly uses
user.extraData['name'].safeCast()instead ofuser.nameto avoid the fallback to user ID, ensuring null is sent when no name is set.
This change ensures that the user's `name` in `ConnectUserDetails` is sourced from `user.extraData['name']` instead of defaulting to `user.id`. This prevents the user's ID from being inadvertently used as their display name during the WebSocket connection process.
7cff64e to
f6edfef
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2451 +/- ##
=======================================
Coverage 64.60% 64.60%
=======================================
Files 420 420
Lines 26210 26210
=======================================
+ Hits 16932 16934 +2
+ Misses 9278 9276 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This change adds `assetUrl` as a fallback option when determining the image URL for a thumbnail. The priority is now `thumbUrl`, then `imageUrl`, and finally `assetUrl`. This ensures that an image thumbnail can still be displayed even if the `thumbUrl` and `imageUrl` are not available, by using the local asset URL as a last resort.
Submit a pull request
Fixes: #2447
Description of the pull request
This PR ensures that the user's
nameinConnectUserDetailsis sourced fromuser.extraData['name']instead of defaulting touser.id.This prevents the user's ID from being inadvertently used as their display name during the WebSocket connection process.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.