Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

My Site Dashboard - Phase 2 - Fix Indefinite Pull-to-Refresh on Application Closed #15767

Closed
ParaskP7 opened this issue Dec 24, 2021 · 2 comments · Fixed by #15799
Closed

My Site Dashboard - Phase 2 - Fix Indefinite Pull-to-Refresh on Application Closed #15767

ParaskP7 opened this issue Dec 24, 2021 · 2 comments · Fixed by #15799

Comments

@ParaskP7
Copy link
Contributor

ParaskP7 commented Dec 24, 2021

Parent: #15198

Expected behavior

When closing the application using the back press/swipe and then re-opening, the pull-to-refresh appears for a second or two, while refresh is happening, and then it should disappear.

Actual behavior

When closing the application using the back press/swipe and then re-opening, the pull-to-refresh appears, while refreshing is happening, but then it never disappears.

Steps to reproduce the behavior

  • Open app.
  • Verify that the pull-to-refresh appears for a second or two, and then disappears.
  • Back press/swipe to close app.
  • Re-open app.
  • Verify that the pull-to-refresh appears but never disappears.
Tested on [device], Android [version], WPAndroid [version]

Tested on [Pixel 4], Android [12], WPAndroid [18.9]

@ParaskP7 ParaskP7 added this to the 19.0 milestone Dec 24, 2021
@ParaskP7 ParaskP7 changed the title My Site Dashboard - Phase 2 - Fix Indefinite Pull-to-Refresh on Application Closed due to Back Press/Swipe My Site Dashboard - Phase 2 - Fix Indefinite Pull-to-Refresh on Application Closed Dec 24, 2021
@zwarm
Copy link
Contributor

zwarm commented Jan 3, 2022

Quick notes:
When the app is returned from the background the value of selectedSiteRepository.hasSelectedSite(), the refresh mutableLiveData, is true. Since we are not requesting a new fetch of site data, we are left in a state of refreshing because there is no event to trigger the false. For a quick test just update SelectedSiteSource.init as follows:

init {
        if (selectedSiteRepository.hasSelectedSite()) {
            super.onRefreshedMainThread()
        }
        dispatcher.register(this)
    }

This little snippet will turn off the refresh flag on return from background when there already is a selected site. @ashiagr - perhaps we can pair up to talk about possible solutions. I only gave it a cursory look late today.Thanks.

@ashiagr
Copy link
Contributor

ashiagr commented Jan 4, 2022

Thanks for taking a look, @zwarm! Let's pair up today to see what's going on. 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants