mattermost-mobile-upstream/app/components/post_list
Mattermost Build 3dda07ff03
Fix three causes of channels rendering blank (#9992) (#10000)
* Fix three causes of channels rendering blank

Recover a channel whose newest interval lost all its posts. A since-fetch
is the only path that receives deletions, and handlePosts destroys those
posts locally — but nothing shrinks the PostsInChannel interval they came
from. An empty interval still wins postsInChannel[0] and renders blank,
and no later since-fetch can repopulate it: once lastFetchedAt is past
the deletion the server correctly returns nothing. fetchPostsForChannel
now detects that state, drops the interval and pulls a page instead,
which merges into a surviving interval or records a real gap that closes
on scroll. Scoped to fetchOnly=false; the fetchOnly callers can leave the
same state behind but are repaired when the user opens the channel.

Thread payloads no longer advance MyChannel.lastFetchedAt. A CRT
thread-reply push carries only that thread's posts, so it is not evidence
the channel was fetched up to the reply's timestamp — advancing the
watermark let getPostsSince skip channel posts that were never fetched.
handlePosts already skips PostsInChannel for RECEIVED_IN_THREAD, and the
native handlers already guard this via receivingThreads.

Pull-to-refresh self-heals as a manual escape hatch for blank states the
automatic recovery cannot see — an interval holding only posts that get
filtered out (replies with CRT on, join/leave messages). Blankness is
measured from orderedPosts rather than posts so it accounts for those
filters.

Also fixes deletePostsForChannel, which returned early when a channel had
no posts left — precisely the post-less-interval case — and never
destroyed intervals because it called .length on a Query instead of
fetching it.

* test feedback

* fix tests

* more test fixes

(cherry picked from commit d1e1f936b6)

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2026-08-05 08:10:11 +03:00
..
combined_user_activity Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
date_separator Update dependencies and upgrade to RN 0.76.5 (#8421) 2025-01-16 07:11:32 -07:00
more_messages Multiple Fixes (#9767) 2026-05-19 16:35:20 +08:00
new_message_line Upgrade Dependencies (#7299) 2023-04-21 12:16:54 -04:00
post [MM-66230] Add AI-generated sparkle indicator to post headers (#9835) 2026-07-14 19:31:02 +00:00
thread_overview fix: app bugs surfaced by Detox RF migration (#9789) 2026-06-09 13:25:42 +05:30
config.ts Multiple Fixes (#9767) 2026-05-19 16:35:20 +08:00
index.ts Mattermost Blocks (#9764) 2026-06-29 18:42:16 +02:00
post_list.test.tsx Fix three causes of channels rendering blank (#9992) (#10000) 2026-08-05 08:10:11 +03:00
post_list.tsx Fix three causes of channels rendering blank (#9992) (#10000) 2026-08-05 08:10:11 +03:00
refresh_control.tsx Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
scroll_to_end_view.tsx Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00