mattermost-mobile-upstream/app/queries
Guillermo Vayá e23419f65f Reset the cached posts when refreshing a channel that renders nothing
Pull-to-refresh on a channel does a plain page-0 fetch, which is exactly the
thing that cannot recover a channel hidden by bad PostsInChannel bookkeeping:
the interval it creates sorts below the bad one, so the list keeps rendering
the bad interval and stays empty. Refreshing is also the moment the user is
telling us the screen looks wrong, so it is a good place to escalate.

refreshPostsForChannel now takes whether the list is rendering nothing. When
it is, and the channel still has non-deleted posts stored, those posts are
hidden rather than absent: clear the channel's cached posts and re-fetch from
scratch, the same recovery as "Reset cached messages". Otherwise -- posts on
screen, or a genuinely empty channel -- keep the previous page fetch.

This covers the cases the interval prune cannot: an interval that holds posts
none of which the list renders (all replies with CRT on, or only join/leave
messages with that preference off) survives the prune but still shows nothing.

The blankness signal is `orderedPosts`, i.e. what the list actually renders
after preparePostList, so it accounts for the filtering the prune's DB-level
check cannot see. The warning it logs (channel id and a count, no PII) is also
the breadcrumb that was missing from the report that started this.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-28 16:20:58 +02:00
..
app Mm 68767 zero persistence (#9803) 2026-07-16 13:55:45 +02:00
servers Reset the cached posts when refreshing a channel that renders nothing 2026-07-28 16:20:58 +02:00