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

If the step index saved in the instance state is invalid reset the wizard #19760

Merged
merged 4 commits into from
Dec 8, 2023

Conversation

antonis
Copy link
Contributor

@antonis antonis commented Dec 8, 2023

Fixes #19758

Description

Under undefined conditions the Site Creation flow is resumed with an invalid step retrieved from the saved instance state. This results in a crash due to an unhandled exception thrown in the step validation. This PR adds exception handling and resets the site creation flow in this edge case.

IllegalStateException: Invalid index.
    at org.wordpress.android.util.wizard.WizardManager.setCurrentStepIndex(WizardManager.kt:52)
    at org.wordpress.android.ui.sitecreation.SiteCreationMainVM.start(SiteCreationMainVM.kt:172)
    at org.wordpress.android.ui.sitecreation.SiteCreationActivity.onCreate(SiteCreationActivity.kt:11

To Test:

  • I wasn't able to reproduce the crash thus a sanity check on the flow is recommended.

Regression Notes

  1. Potential unintended areas of impact

Site Creation

  1. What I did to test those areas of impact (or what existing automated tests I relied on)

Manual testing

  1. What automated tests I added (or what prevented me from doing so)

New test with in the SiteCreationMainVMTest.kt


PR Submission Checklist:

  • I have completed the Regression Notes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

UI Changes Testing Checklist:

  • Portrait and landscape orientations.
  • Light and dark modes.
  • Fonts: Larger, smaller and bold text.
  • High contrast.
  • Talkback.
  • Languages with large words or with letters/accents not frequently used in English.
  • Right-to-left languages. (Even if translation isn’t complete, formatting should still respect the right-to-left layout)
  • Large and small screen sizes. (Tablet and smaller phones)
  • Multi-tasking: Split screen and Pop-up view. (Android 10 or higher)

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Dec 8, 2023

Jetpack📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack Jetpack
FlavorJalapeno
Build TypeDebug
Versionpr19760-bf6fe27
Commitbf6fe27
Direct Downloadjetpack-prototype-build-pr19760-bf6fe27.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Dec 8, 2023

WordPress📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress WordPress
FlavorJalapeno
Build TypeDebug
Versionpr19760-bf6fe27
Commitbf6fe27
Direct Downloadwordpress-prototype-build-pr19760-bf6fe27.apk
Note: Google Login is not supported on these builds.

@antonis antonis marked this pull request as ready for review December 8, 2023 18:31
@antonis antonis requested a review from justtwago December 8, 2023 18:38
Copy link
Contributor

@justtwago justtwago left a comment

Choose a reason for hiding this comment

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

Thank you for the fix and the test for it! Looks good to me! 👍

@justtwago justtwago merged commit ddad2ae into trunk Dec 8, 2023
2 checks passed
@justtwago justtwago deleted the fix/19758-InvalidWizardStep branch December 8, 2023 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants