kuuuurt / multiplatform-paging

Kotlin Multiplatform library for Pagination
Apache License 2.0
250 stars 22 forks source link

Crash on Android when refreshing (version 0.6.x) #34

Closed ilmooo closed 1 year ago

ilmooo commented 1 year ago

Library causes crash on Android when trying to refresh.

Steps to reproduce:

  1. Create pager and collect items in view.
  2. Call 'refresh'-function on Pager or on LazyPagingItems (Compose).
  3. Application crashes.

Crash description:

An instance of PagingSource was re-used when Pager expected to create a new instance. Ensure that the pagingSourceFactory passed to Pager always returns a new instance of PagingSource.

How to fix:

Always create new PagingSource from pagingSourceFactory. See pull request #33.

kuuuurt commented 1 year ago

Thank you for your contribution. This has been merged and will be available on 0.6.2