Skip to content

Issue/13326 support provisioning and invalid scan states#13923

Merged
ashiagr merged 16 commits intodevelopfrom
issue/13326-support-missing-scan-states
Feb 1, 2021
Merged

Issue/13326 support provisioning and invalid scan states#13923
ashiagr merged 16 commits intodevelopfrom
issue/13326-support-missing-scan-states

Conversation

@ashiagr
Copy link
Copy Markdown
Contributor

@ashiagr ashiagr commented Feb 1, 2021

Parent #13326

This PR supports below scan states:

  • Provisioning (displays provisioning state items using Calypso's logic)
  • Invalid: UnAvailable and Unknown (displays full screen error)
Provisioning State Invalid State
provisioning full-screen-error

EDIT:
This PR also updates scanning state description for initial scan (Calypso's logic).

Scanning (MostRecentStatus.isInitial = true) Scanning (MostRecentStatus.isInitial = false)
initial_scanning initial_false_scanning

To test

Prerequisite:

  • Make sure both Scan feature flag and MySiteImprovements flag are set to on in the App settings.
  • You have access to WP.com account with a site having scan capability and threats (e.g. https://pressable-jetpack-daily-scan.mystagingwebsite.com). Server credentials should be set on the site.

You can test the changes in either ways:

  1. by running newly added tests in ScanStateListItemsBuilderTest and ScanViewModelTest

or

  1. by commenting these lines in FetchScanStateUseCase, adding below lines for required scan state at line 39 and accessing the scan screen in the app.

PROVISIONING State

emit(Success(ScanStateModel(state = ScanStateModel.State.PROVISIONING)))
return@flow

UNKNOWN State

emit(Success(ScanStateModel(state = ScanStateModel.State.UNKNOWN)))
return@flow

UNAVAILABLE State

emit(Success(ScanStateModel(state = ScanStateModel.State.UNAVAILABLE)))
return@flow

SCANNING State

emit(Success(ScanStateModel(state = ScanStateModel.State.SCANNING, mostRecentStatus = ScanProgressStatus(isInitial = <true/false>, startDate = Date(0)))))
return@flow

Merge Instructions

  1. Make sure PR Issue/13326 scan full screen loading & error handling #13920 is merged to develop
  2. Remove the "Not Ready for Merge label"
  3. Merge this PR

PR submission checklist:

  • I have considered adding unit tests where possible.
  • 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.

@peril-wordpress-mobile
Copy link
Copy Markdown

peril-wordpress-mobile bot commented Feb 1, 2021

You can trigger optional UI/connected tests for these changes by visiting CircleCI here.

@peril-wordpress-mobile
Copy link
Copy Markdown

peril-wordpress-mobile bot commented Feb 1, 2021

You can test the changes on this Pull Request by downloading the APK here.

@ashiagr ashiagr requested a review from ParaskP7 February 1, 2021 05:53
@ashiagr ashiagr mentioned this pull request Feb 1, 2021
67 tasks
@ashiagr ashiagr removed the request for review from ParaskP7 February 1, 2021 06:09
@ashiagr ashiagr force-pushed the issue/13326-support-missing-scan-states branch from b642558 to 03f0114 Compare February 1, 2021 06:48
@ashiagr ashiagr requested a review from ParaskP7 February 1, 2021 07:03
Copy link
Copy Markdown
Contributor

@ParaskP7 ParaskP7 left a comment

Choose a reason for hiding this comment

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

👋 @ashiagr !

I have reviewed and tested this PR as per the instruction, great job! Also, kudos for splitting the commit so nicely and for the very helpful test instruction! 🌟 🌟 🌟

I have left only one minor (🔍) test related comment. I am going to approve this PR anyway, since none is blocking. I am NOT going to merge this PR yet to give you some time to apply my only suggestion. However, feel free to ignore them and merge the PR yourself.

@ParaskP7 ParaskP7 self-assigned this Feb 1, 2021
@ashiagr ashiagr requested a review from ParaskP7 February 1, 2021 13:21
…rt-missing-scan-states

# Conflicts:
#	WordPress/src/test/java/org/wordpress/android/ui/jetpack/scan/ScanViewModelTest.kt
Base automatically changed from issue/13326-scan-error-handling to develop February 1, 2021 13:59
@ashiagr ashiagr merged commit 30a23de into develop Feb 1, 2021
@ashiagr ashiagr deleted the issue/13326-support-missing-scan-states branch February 1, 2021 14:41
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.

2 participants