Closed atorresveiga closed 2 days ago
App Name | WooCommerce-Wear Android | |
Platform | ⌚️ Wear OS | |
Flavor | Jalapeno | |
Build Type | Debug | |
Commit | 6fe67594b9553f7de02f4c3e2ee0801b8d4020b9 | |
Direct Download | woocommerce-wear-prototype-build-pr12948-6fe6759.apk |
📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.
App Name | WooCommerce Android | |
Platform | 📱 Mobile | |
Flavor | Jalapeno | |
Build Type | Debug | |
Commit | 6fe67594b9553f7de02f4c3e2ee0801b8d4020b9 | |
Direct Download | woocommerce-prototype-build-pr12948-6fe6759.apk |
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 39.66%. Comparing base (
9a83bcc
) to head (6fe6759
). Report is 5 commits behind head on trunk.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
🚨 Try these New Features:
Closes: #12941
Description
This pull request addresses the issue of the PTR (Pull-to-Refresh) getting stuck in the user interface after exiting the search view while the search is still in progress.
When we subscribe to the new
pagedListWrapper
in theactivatePagedListWrapper
function, the new LiveData starts off asnull
and does not emit any value until the list changes. We also remove the previous source by callingclearLiveDataSources
. However, because_isFetchingFirstPage
is aMediatorLiveData
, it retains the last cached value. This leads to a problem: when we exit the search view and switch to the newactivatePagedListWrapper
, the screen state remains stuck in a refreshing state. This occurs because_isFetchingFirstPage
does not reflect the state of the currentactivatePagedListWrapper
(which isnull
), but rather the last cached value.To resolve this issue, I have chosen to reset the LiveData to its default values within the
clearLiveDataSources
function.I considered an alternative solution that involved adding an initial value to the PagedListWrapper LiveData. However, since this class is utilized in other projects as well, I opted for the current solution to minimize the impact on our code and prevent any regressions in those other projects.
Steps to reproduce
Testing information
The tests that have been performed
Images/gif
https://github.com/user-attachments/assets/8e3ef9b5-2e6c-4419-b441-648fa1b749d6
RELEASE-NOTES.txt
if necessary. Use the "[Internal]" label for non-user-facing changes.Reviewer (or Author, in the case of optional code reviews):
Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement: