Now that #254 has landed, all of the MessageAction::ReplyPreviewClicked action handling logic should be moved to a background thread.
Similarly, we should limit the number of items that we do a backwards search through on the main UI thread to no more than 25-50 items. Just like the known problem with PortalList::smooth_scroll_to(), we need to avoid iterating over potentially thousands of items on the main UI thread.
The main idea is that we would re-use the same BackwardsPaginateUntilEventRequest, and that the first operation that the timeline_subscriber_handler would take upon receiving that request is to search the existing known vector of timeline items for the target event before kicking off a backwards pagination request.
Now that #254 has landed, all of the
MessageAction::ReplyPreviewClicked
action handling logic should be moved to a background thread. Similarly, we should limit the number of items that we do a backwards search through on the main UI thread to no more than 25-50 items. Just like the known problem withPortalList::smooth_scroll_to()
, we need to avoid iterating over potentially thousands of items on the main UI thread.The main idea is that we would re-use the same
BackwardsPaginateUntilEventRequest
, and that the first operation that thetimeline_subscriber_handler
would take upon receiving that request is to search the existing known vector of timeline items for the target event before kicking off a backwards pagination request.Originally posted by @kevinaboos in https://github.com/project-robius/robrix/issues/254#issuecomment-2484515497