Fix loading initial items of non-live timelines#6598
Conversation
|
📱 Scan the QR code below to install the build (arm64 only) for this PR. |
f10d82f to
b1c07d9
Compare
bmarty
left a comment
There was a problem hiding this comment.
Thanks, I confirm that it fixes the issue of empty thread timeline on my side
|
|
||
| // If we are not in live timeline mode, and we have no timeline items, we need to back paginate to load some messages. | ||
| // This was previously done by the SDK, and we received a `Reset` update, but now we need to do it ourselves. | ||
| val isEmptyNonLiveTimelineFlow = layoutInfoFlow.map { it.totalItemsCount == 0 && timelineMode != Timeline.Mode.Live } |
There was a problem hiding this comment.
Is the test on timelineMode necessary here?
There was a problem hiding this comment.
It may not bee needed. Since live timelines are supposed to always have at least 1 item, the it.totalItemsCount == 0 check wouldn't be used and we wouldn't unnecessarily paginate.
There was a problem hiding this comment.
It worked fine when I tested this without the mode check: f43317b
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #6598 +/- ##
========================================
Coverage 81.14% 81.14%
========================================
Files 2623 2623
Lines 72804 72806 +2
Branches 9418 9418
========================================
+ Hits 59078 59080 +2
Misses 10254 10254
Partials 3472 3472 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This was done automatically by the SDK in the past by returning a `Reset` timeline update, but this behaviour changed and now we have to do it.
b1c07d9 to
f43317b
Compare
|



Content
Items in non-live timelines aren't loaded automatically anymore if they're not present in the cache. This is specially easy to spot when loading a thread timeline.
This was done automatically by the SDK in the past by returning a
Resettimeline update, but this behaviour changed and now we have to do it.Motivation and context
Fix the initial loading of timeline items when they're not cached after matrix-org/matrix-rust-sdk#6380.
Tests
Either clear the cache or make sure you're opening a thread you haven't loaded yet. Open the thread screen, if timelines appear, this should be fixed.
Tested devices
Checklist