-
-
Notifications
You must be signed in to change notification settings - Fork 922
Labels
Milestone
Description
As part of #5429 , I removed the recursion in post_view.list
calling itself, but my corrections are wrong.
My questions are:
- Why is this necessary? Is it only used for backwards pagination for
Subscribed
? - Are there better ways we should be handling subscribed? I have some ideas here.
not correct, because it has to use the same sort as the normal query for correct results, and it has to use the same filters for full optimization
probably best to:
- move everything currently in
list
to a new helper function likelist_inner
which takes additional parameterscursor_before_data: Option<Post>, community_id_for_prefetch: Option<CommunityId>
- remove
cursor_before_data
andcommunity_id_just_for_prefetch
fromPostQuery
- make
list
just be a wrapper function that does mostly the same thing as theprefetch_cursor_before_data
function here but uses 2 calls tolist_inner
(first one is for getting the upper bound) - also in the
list
wrapper function, add back the conditionself.listing_type == Some(ListingType::Subscribed)
and useif let
to replace theself.local_user.is_some()
condition, so getting an upper bound is only done for subscribed view
Originally posted by @dullbananas in #5429 (comment)