Defer fetching of invited room avatars just like for joined rooms#743
Conversation
Prevents blocking the room list processing loop when processing invited rooms by deferring avatar fetching to a background task. This mirrors the behavior of joined rooms and improves the responsiveness of the app, especially when handling multiple invites or slow network connections. - Updates `add_new_room` in `src/sliding_sync.rs` to spawn `spawn_fetch_room_avatar` for invited rooms instead of awaiting `room_avatar`. - Updates `handle_rooms_list_updates` in `src/home/rooms_list.rs` to handle `UpdateRoomAvatar` updates for invited rooms. Co-authored-by: kevinaboos <1139460+kevinaboos@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
💡 What: Optimized the adding of invited rooms to the room list by fetching their avatars asynchronously in the background.
🎯 Why: Previously,
add_new_roomwouldawaitthe avatar fetch for invited rooms. If the network was slow or there were many invites, this would block theroom_list_service_loop, delaying the display of the entire room list (sincejoin_allwaits for all futures). This change makes the initial display instant with a text avatar placeholder, and the image pops in when loaded.📊 Impact: Reduces the latency of room list updates when invited rooms are present. Improves perceived performance during initial sync or batch updates.
🔬 Measurement: Verified via code logic analysis and
cargo check. The change moves network I/O out of the critical path of the room list processing loop.PR created automatically by Jules for task 17181599463947151992 started by @kevinaboos