-
Notifications
You must be signed in to change notification settings - Fork 13
Optimize group image path loading and DM header #777
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
Optimize group image path loading and DM header #777
Conversation
Refactored group image path loading to handle direct messages and groups differently, improving performance and error handling and streamline member data retrieval.
WalkthroughThe group provider refactors metadata and image path loading to use parallelized operations instead of sequential calls. New helper methods handle DMs and groups distinctly, introduce caching for group image paths and types, and add batch processing scaffolding. The chat header widget removes non-functional comments. Changes
Sequence DiagramsequenceDiagram
participant Provider as Group Provider
participant Cache as Image Path Cache
participant API as Rust API
participant Other as Other Member Data
Note over Provider,Other: Old: Sequential Loading
Provider->>API: Load group 1 image path
API-->>Provider: Return path
Provider->>API: Load group 2 image path
API-->>Provider: Return path
Note over Provider,Other: New: Parallel Loading with Caching
par Load Group 1
Provider->>Cache: Check cache
alt Cache miss
Provider->>API: Load image path
API-->>Provider: Return path
Provider->>Cache: Store path
else Cache hit
Cache-->>Provider: Return cached path
end
and Load Group 2
Provider->>Other: Get DM member image
Other-->>Provider: Return image path
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
🧰 Additional context used📓 Path-based instructions (2)**/*.dart📄 CodeRabbit inference engine (.cursor/rules/flutter.mdc)
Files:
lib/**/*.dart📄 CodeRabbit inference engine (.cursor/rules/flutter.mdc)
Files:
🧠 Learnings (3)📓 Common learnings📚 Learning: 2025-09-14T21:22:00.962ZApplied to files:
📚 Learning: 2025-09-07T02:15:31.931ZApplied to files:
⏰ 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). (1)
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 |
Quwaysim
left a 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.
LGTM
…at-screen-doesnt-show
Refactored group image path loading to handle direct messages and groups differently, improving performance and error handling and streamline member data retrieval.
Description
Fix profile images not displaying in direct messages (#772)
Problem
User profile images were not showing in:
Root Cause
Two-path image loading system mismatch:
groupImagePathscache (from Rust API)otherMember.imagePath) existed but were never usedSolution
Unified image caching in the provider layer based on group type:
otherMember.imagePathdirectlyUI remains unchanged - still watches the unified
groupImagePathsmap, now populated for both DMs and groups.Implementation
Modified image loading in
GroupsNotifier:_loadGroupImagePathForGroup()- Type-aware single group loading_loadGroupImagePaths()- Type-aware batch loadingBoth methods check group type and source image accordingly before caching.
Key Benefit
Type of Change
Checklist
just precommitto ensure that formatting and linting are correctjust check-flutter-coverageto ensure that flutter coverage rules are passingCHANGELOG.mdfile with your changes (if they affect the user experience)Summary by CodeRabbit
Refactor
Chores