mattermost-mobile-upstream/app
Mattermost Build 892ff8e058
Fix three causes of channels rendering blank (#9992) (#9999)
* 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:03 +03:00
..
actions Fix three causes of channels rendering blank (#9992) (#9999) 2026-08-05 08:10:03 +03:00
client Receive Mattermost Calls through iOS native incoming-call UI (#9780) 2026-06-16 12:08:14 -03:00
components Fix three causes of channels rendering blank (#9992) (#9999) 2026-08-05 08:10:03 +03:00
constants Remove Legacy Interactive Dialog code (#9770) (#9857) 2026-06-18 09:12:04 +03:00
context Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
database fix critical crashes on Android (#9871) (#9874) 2026-06-23 03:03:10 +08:00
helpers Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
hooks fix: app bugs surfaced by Detox RF migration (#9789) 2026-06-09 13:25:42 +05:30
i18n Add autotranslations (#9324) 2026-02-10 17:50:39 +01:00
init [MM-69124] Remove temporary device-verification logs (#9860) (#9885) 2026-06-23 23:39:17 +02:00
keyboard resumes slide animation after stopping due to modal system dialog showing (#9792) 2026-05-29 06:50:57 +08:00
managers Receive Mattermost Calls through iOS native incoming-call UI (#9780) 2026-06-16 12:08:14 -03:00
products fixes audio devices not showing on android audio selector during a call (#9905) (#9906) 2026-07-03 08:10:33 +03:00
queries fix critical crashes on Android (#9871) (#9874) 2026-06-23 03:03:10 +08:00
routes Route through usePropsFromParams for remaining stragglers (#9949) (#9950) 2026-07-18 20:10:00 +03:00
screens Fix passing number strings through screen params (#9931) (#9935) 2026-07-17 08:00:48 +03:00
store Receive Mattermost Calls through iOS native incoming-call UI (#9780) 2026-06-16 12:08:14 -03:00
utils Fix passing number strings through screen params (#9931) (#9935) 2026-07-17 08:00:48 +03:00