Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Attachment actions
Unintended behavior
View staffing
Description
Version used: 3.3.2
Devices/Android versions reproduced on: Pixel 6A API 34, Pixel 8 API 34
The getRefreshKey of the Room DB paging source is glitchy while room is being update. When I create my own custom paging source with getRefreshKey overidden, this issue does not happen; however, we lose out on live data updates if I use custom paging source. Is it possible to fix the get refresh key or make it customizable for the room db paging source or fix the default implementation of the the room paging source to use a refresh key that doesnt jump around like in the video attached?
override fun getRefreshKey(state: PagingState<Int, LibraryProductItem>): Int? {
return state.anchorPosition?.let { anchorPosition ->
val anchorPage = state.closestPageToPosition(anchorPosition)
anchorPage?.prevKey?.plus(1) ?: anchorPage?.nextKey?.minus(1)
}
}
If this is a bug in the library, we would appreciate if you could attach:
- Sample project to trigger the issue.
- A screenrecord or screenshots showing the issue (if UI related).