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

Fix issue - NewSiteCreationService can enter invalid state #9141

Merged
merged 2 commits into from
Jan 30, 2019

Conversation

malinajirka
Copy link
Contributor

Fixes #9138

This PR fixes a bug when NewSiteCreation service could enter an invalid state - the UI kept showing an infinite progress indicator.

This is happening when we start creating the site when we don't have an internet connection. The NewSiteCreationService.createSite(..) is not called since we check the internet availability before we call it. However, the service is created anyway when NewSiteCreationPreviewFragment binds to it in onResume. The default state of the service is IDLE, however this line prevents the service from actually starting the task when the user clicks on the retry button.

The flow works as expected when the internet connection is available since the NewSiteCreationService.createSite(..) is invoked before the service is created and therefore the state of the service is null and not IDLE.

To test:

  • set "don't keep activities" in the developer settings
  1. My Site
  2. Switch Site
  3. Plus sign icon
  4. Create WordPress.com site
  5. Select segment
  6. Skip
  7. Skip
  8. Select a domain
  9. Turn On Airplane mode
  10. Create Site
  11. Error is shown
  12. Turn off Airplane mode
  13. Retry
  14. Press the home button
  15. Go back to the app
  16. Make sure the fullscreen error is not shown and the site is eventually created

Update release notes:

  • [ x ] If there are user facing changes, I have added an item to RELEASE-NOTES.txt.

@oguzkocer oguzkocer self-assigned this Jan 30, 2019
Copy link
Contributor

@oguzkocer oguzkocer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good :shipit: Tested and works as expected!

I was actually going to ask about this in the original PR, but I wasn't sure if the IDLE step mattered or not. I should have asked it still, sorry for missing this!

@oguzkocer oguzkocer merged commit 825abd0 into develop Jan 30, 2019
@oguzkocer oguzkocer deleted the issue/9138-invalid-site-creation-state branch January 30, 2019 23:30
@malinajirka
Copy link
Contributor Author

@oguzkocer :D I would have told you it entered the IDLE state only in NewSiteCreationServiceManager.onStart() as I didn't realize the service is started when the fragment/activity binds to it. I'm sorry for the extra overhead testing this, I should have realized it and implement it correctly in the first place.

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

Successfully merging this pull request may close these issues.

[Site Creation] Infinite progress indicator
2 participants