Skip to content

Issue/13326 check fix threat status on init#13904

Merged
ashiagr merged 10 commits intodevelopfrom
issue/13326-check-fix-threat-status-on-init
Jan 29, 2021
Merged

Issue/13326 check fix threat status on init#13904
ashiagr merged 10 commits intodevelopfrom
issue/13326-check-fix-threat-status-on-init

Conversation

@ashiagr
Copy link
Copy Markdown
Contributor

@ashiagr ashiagr commented Jan 28, 2021

Parent #13326

This PR fetches fix threats status for fixable threats (from scan state in db), and if found in fix in progress state, displays a progress bar on vm init.

It also

  • Adds FetchFixThreatsState.NotStarted for FixStatus.NOT_STARTED 7814b6c
  • Refreshes threats list when FixFailure state is encountered only for a sublist of status models d294252, b187ebe
  • Removes fix threats started message 46638b2

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 multiple threats (e.g. http://do.wpmt.co/jp-scan-daily).
  1. Login to the app using above WP.com account and select the site on the My Site tab.

  2. Click scan menu item on My Site.

  3. Click fix threats button on scan screen.

  4. Notice that fix threats progress bar is shown.

  5. Return to My Site, re-enter Scan screen while threats are fixing.

  6. Notice that fix threats progress bar is re-shown on scan screen.

  7. Wait for fix to complete.

  8. Notice that scan screen is refreshed with latest scan state.

    Test covered in FetchFixThreatsStatusUseCaseTest, ScanViewModelTest.

Notes

  1. Moving "in progress" fix threats state to a full screen modal and other proposed changes in pcdRpT-cM#comment-222 are not yet covered in this PR.
  2. Jetpack Threat Tester (Internal ref: pbuNQi-Kb) can be used to re-add threats once they're fixed. Let me know if you need a help.

Merge Instructions

  1. Make sure PR Issue/13326 start scan after delay #13903 is merged to develop - Done
  2. Remove the "Not Ready for Merge label" - Done
  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 Jan 28, 2021

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

@ashiagr ashiagr added this to the 16.7 milestone Jan 28, 2021
@ashiagr ashiagr self-assigned this Jan 28, 2021
@peril-wordpress-mobile
Copy link
Copy Markdown

peril-wordpress-mobile bot commented Jan 28, 2021

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

@ashiagr ashiagr requested a review from malinajirka January 28, 2021 11:17
@ashiagr ashiagr marked this pull request as ready for review January 28, 2021 11:24
…eck-fix-threat-status-on-init

# Conflicts:
#	WordPress/src/test/java/org/wordpress/android/ui/jetpack/scan/ScanViewModelTest.kt
@malinajirka malinajirka self-assigned this Jan 28, 2021
Copy link
Copy Markdown
Contributor

@malinajirka malinajirka left a comment

Choose a reason for hiding this comment

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

Thanks @ashiagr! I found one issue but I don't think it's related to these changes.

Jetpack Threat Tester

I wasn't able to make this plugin work - even when I uncheck -> check the threats, the scan still won't find them. However, I tested the app with the calendar plugin. Any tips what I might be missing?

Potential issues

  1. Open Scan screen
  2. Quickly click on "Scan Now"
  3. Notice the scan starts and finishes within a few ms
  4. Quickly go back to My Site
  5. Open Scan screen again and notice there is a scan in progress

@ashiagr ashiagr mentioned this pull request Jan 29, 2021
67 tasks
@ashiagr
Copy link
Copy Markdown
Contributor Author

ashiagr commented Jan 29, 2021

Thanks for the review @malinajirka! I've added potential issue in the low priority tasks on the main issue.

Merging this PR now.

Base automatically changed from issue/13326-start-scan-after-delay to develop January 29, 2021 08:44
@ashiagr ashiagr merged commit e56481f into develop Jan 29, 2021
@ashiagr ashiagr deleted the issue/13326-check-fix-threat-status-on-init branch January 29, 2021 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants