Skip to content
This repository was archived by the owner on May 23, 2025. It is now read-only.

Conversation

@connyduck
Copy link
Collaborator

@connyduck connyduck commented Apr 22, 2025

When using the database as PagingSource, it can happen that there are null items, e.g. when the user jumps to the top and the items are no longer in memory and need to be re-queried. We have ignored this fact until now, leading to subtle bugs where the adapter just shows a completely empty ViewHolder, or worse, a recycled ViewHolder that has not been updated and shows the wrong post. Usually these are only visible for a split second but it can take longer in some cases e.g. on slow devices.

Here is how the placeholders look:

Note: I would prefer to turn this behavior with the null items off, but we tried that once and it led to even worse bugs: #4471

@connyduck connyduck requested review from Tak and charlag April 22, 2025 13:06
# Conflicts:
#	app/src/main/java/com/keylesspalace/tusky/components/timeline/TimelinePagingAdapter.kt
@connyduck connyduck merged commit 9563e55 into develop Apr 29, 2025
1 check passed
@connyduck connyduck deleted the null-placeholders branch April 29, 2025 17:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants