Skip to content
This repository was archived by the owner on Feb 4, 2025. It is now read-only.

ScanStore: Store scan state into DB#1780

Merged
ashiagr merged 9 commits intodevelopfrom
issue/scan-db-sql
Nov 26, 2020
Merged

ScanStore: Store scan state into DB#1780
ashiagr merged 9 commits intodevelopfrom
issue/scan-db-sql

Conversation

@ashiagr
Copy link
Copy Markdown
Contributor

@ashiagr ashiagr commented Nov 23, 2020

Issue: wordpress-mobile/WordPress-Android#13326

This PR stores scan state into DB.
Currently it does not save credentials and threats and focuses mainly on storing scan progress status.

To test
That scan progress status is correctly saved into the DB.

Notes

  1. Note that out of 4 different scan states (IDLE, SCANNING, PROVISIONING, UNAVAILABLE) only IDLE and SCANNING states return the progress status.

    IDLE state: returns most_recent status (current is null)
    SCANNING state: returns current status (most_recent is null)

Since either most_recent or current is valid for these states, fields like progress, isInitial, startDate are not created separately for most_recent and current.

  1. We might want to reuse RewindStatusCredentials for storing Credentials for scan functionality as both refer to the same set of credentials. Currently RewindStatusCredentials is not used anywhere in WordPress-Android, will consider storing credentials returned in scan state response later when we really need it.

@ashiagr ashiagr self-assigned this Nov 23, 2020
@ashiagr ashiagr requested a review from malinajirka November 23, 2020 12:05
# Conflicts:
#	example/src/test/java/org/wordpress/android/fluxc/store/ScanStoreTest.kt
@ashiagr ashiagr requested a review from zwarm November 25, 2020 12:22
@ashiagr ashiagr marked this pull request as ready for review November 25, 2020 12:26
@malinajirka malinajirka self-assigned this Nov 26, 2020
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've left two minor comments. It LGTM - feel free to merge it.

Base automatically changed from issue/scan-api-tests to develop November 26, 2020 09:42
@malinajirka
Copy link
Copy Markdown
Contributor

Thanks for the changes, LGTM! ;)

@ashiagr ashiagr merged commit bce4db5 into develop Nov 26, 2020
@ashiagr ashiagr deleted the issue/scan-db-sql branch November 26, 2020 12:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants