mirror of
https://github.com/mattermost/mattermost-mobile.git
synced 2026-11-22 03:18:12 +00:00
The channel post list renders one interval only: postsInChannel[0], the PostsInChannel row with the greatest `latest`. If that interval ends up with no posts in it, the channel renders zero rows -- it looks blank even though the older posts are still in the database -- and today nothing recovers it. An interval becomes post-less when every post it was built from is deleted on the server: a later fetch returns them with delete_at set, and handlePosts destroys them locally while leaving the interval untouched. From then on: - fetchPostsForChannel takes the since-branch (myChannel.lastFetchedAt is advanced by deletions too, since getLastFetchedAtFromPosts uses max(create_at, update_at, delete_at)), and getPostsSince returns nothing when there is nothing newer, so no post is ever stored again; - the channel_post_list fallback page-0 fetch does store posts, but its interval sorts below the empty one, so postsInChannel[0] is unchanged and the list stays empty; - handleReceivedPostsInChannel does not merge the empty interval away either: it is disjoint and newer than the page just fetched, so the merge loop breaks before reaching it. The MM-66467 fix stopped these intervals from being *created* from deleted posts, but an existing interval that later loses all its posts (or one left behind in a database poisoned by an older build) still hides the channel for good, with "Reset cached messages" as the only way out. So prune them: an interval with no posts carries no information -- re-fetching an empty range is harmless -- and dropping it lets the next interval, or a fresh page fetch, render again. fetchPostsForChannel now prunes when the channel has no visible posts, and stops trusting lastFetchedAt in that state so the fallback is a full page fetch instead of a no-op since-fetch. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| ephemeral_mode | ||
| session | ||
| category.test.ts | ||
| category.ts | ||
| channel_bookmark.test.ts | ||
| channel_bookmark.ts | ||
| channel.test.ts | ||
| channel.ts | ||
| draft.test.ts | ||
| draft.ts | ||
| file.test.ts | ||
| file.ts | ||
| group.test.ts | ||
| group.ts | ||
| post.test.ts | ||
| post.ts | ||
| reactions.test.ts | ||
| reactions.ts | ||
| scheduled_post.test.ts | ||
| scheduled_post.ts | ||
| systems.test.ts | ||
| systems.ts | ||
| team.test.ts | ||
| team.ts | ||
| thread.test.ts | ||
| thread.ts | ||
| user.test.ts | ||
| user.ts | ||