mattermost-mobile-upstream/app
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
..
actions Fix three causes of channels rendering blank (#9992) (#10000) 2026-08-05 08:10:11 +03:00
client Fix link to image proxy and correct padding in image sizing on blocks (#9976) (#9983) 2026-07-30 15:07:57 +03:00
components Fix three causes of channels rendering blank (#9992) (#10000) 2026-08-05 08:10:11 +03:00
constants Mm 68767 zero persistence (#9803) (#9957) 2026-07-20 13:31:53 +03:00
context Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
database Mm 68767 zero persistence (#9803) (#9957) 2026-07-20 13:31:53 +03:00
helpers Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
hooks Mm 68767 zero persistence (#9803) (#9957) 2026-07-20 13:31:53 +03:00
i18n Add autotranslations (#9324) 2026-02-10 17:50:39 +01:00
init Mm 68767 zero persistence (#9803) (#9957) 2026-07-20 13:31:53 +03:00
keyboard resumes slide animation after stopping due to modal system dialog showing (#9792) 2026-05-29 06:50:57 +08:00
managers Mm 68767 zero persistence (#9803) (#9957) 2026-07-20 13:31:53 +03:00
products [MM-68856] Respect default agent and persist last-selected agent in agent selectors (#9829) (#9937) 2026-07-17 08:28:24 +03:00
queries Mm 68767 zero persistence (#9803) (#9957) 2026-07-20 13:31:53 +03:00
routes Route through usePropsFromParams for remaining stragglers (#9949) (#9952) 2026-07-20 08:55:51 +03:00
screens ci(e2e): port E2E CI stack to release-2.43 to unblock merges (#10004) 2026-08-04 16:50:34 +05:30
store Mm 68767 zero persistence (#9803) (#9957) 2026-07-20 13:31:53 +03:00
utils Mm 68767 zero persistence (#9803) (#9957) 2026-07-20 13:31:53 +03:00