mattermost-mobile-upstream/app
Elias Nahum d1e1f936b6
Fix three causes of channels rendering blank (#9992)
* 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
2026-08-03 10:28:19 -03:00
..
actions Fix three causes of channels rendering blank (#9992) 2026-08-03 10:28:19 -03:00
client Fix link to image proxy and correct padding in image sizing on blocks (#9976) 2026-07-30 13:41:26 +02:00
components Fix three causes of channels rendering blank (#9992) 2026-08-03 10:28:19 -03:00
constants [MM-69723, MM-69705] Version-gate ChannelBookmarks and CustomProfileAttributes for flag removal (#9916) 2026-07-29 17:14:33 -03:00
context Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
database Mm 68767 zero persistence (#9803) 2026-07-16 13:55:45 +02:00
helpers Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
hooks Fix shared value lifecycle in useKeyboardEvents (#9924) 2026-07-30 13:30:55 +00:00
i18n Add autotranslations (#9324) 2026-02-10 17:50:39 +01:00
init Mm 68767 zero persistence (#9803) 2026-07-16 13:55:45 +02: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) 2026-07-16 13:55:45 +02:00
products [MM-68856] Respect default agent and persist last-selected agent in agent selectors (#9829) 2026-07-16 20:13:11 -04:00
queries [MM-69723, MM-69705] Version-gate ChannelBookmarks and CustomProfileAttributes for flag removal (#9916) 2026-07-29 17:14:33 -03:00
routes Route through usePropsFromParams for remaining stragglers (#9949) 2026-07-18 19:16:46 +03:00
screens fix(e2e): Quarantine proven flakes and harden Detox harness (#9971) 2026-07-30 02:40:23 +05:30
store fix: push notification navigation delay and stale in-app avatar (#9929) 2026-07-22 14:15:21 +02:00
utils Fix passing number strings through screen params (#9931) 2026-07-16 18:21:40 +02:00