WordPress-FluxC-Android
WordPress-FluxC-Android copied to clipboard
PagedListWrapper doesn't propagate loading state when loading data from local db
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.
- Open a list
- 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
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.