You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
perf: fix ChatListSortRooms FutureBuilder rebuild and lifecycle leaks
Stop recreating the sort Future on every build() call — cache it in
initState/didUpdateWidget instead. This was causing redundant async
sorting of all rooms ~1x/second.
Also fix pre-existing lifecycle bugs in this widget:
- Add dispose() to cancel room StreamSubscriptions (memory leak)
- Add mounted guards after each await in the sort method to prevent
accessing context/widget on a disposed State
- Add a generation counter to invalidate stale sort futures when a
newer sort is triggered before the previous one completes
0 commit comments