WordPress-FluxC-Android icon indicating copy to clipboard operation
WordPress-FluxC-Android copied to clipboard

PagedListWrapper doesn't propagate loading state when loading data from local db

Open malinajirka opened this issue 5 years ago • 1 comments

PagedListWrapper uses 3 observables in order to inform the UI of the current loading state isFetchingFirstPage isLoadingMore isEmpty

However, it doesn't inform the UI when it's loading data from the local database. Here is an example which breaks the UI.

  1. Open a list
  2. Fetching items from the remote finishes, but we are still loading the first batch of data from the local db (isFetchingFirstPage = false, isLoadingMore=false, isEmpty=null)
2019-05-03 10:27:57.945 467-467/org.wordpress.android.beta D/WordPress-POSTS: Size: null, isFetchingFirstpage: true, isListEmpty: null, error: null
2019-05-03 10:27:58.492 467-467/org.wordpress.android.beta D/WordPress-POSTS: Size: null, isFetchingFirstpage: false, isListEmpty: null, error: null
2019-05-03 10:27:58.730 467-467/org.wordpress.android.beta D/WordPress-POSTS: Size: 39, isFetchingFirstpage: false, isListEmpty: false, error: null

It can cause the following issue: https://github.com/wordpress-mobile/WordPress-Android/issues/9717

cc @oguzkocer @AmandaRiu

malinajirka avatar May 03 '19 08:05 malinajirka

I've hot-fixed the issue in WPAndroid in this PR. We might want to revert the change when the issue is fixed in FluxC.

malinajirka avatar May 03 '19 08:05 malinajirka