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

Fix JetpackScan model parsing errors#309

Merged
emilylaguna merged 2 commits intodevelopfrom
task/fix-scan-api
Dec 3, 2020
Merged

Fix JetpackScan model parsing errors#309
emilylaguna merged 2 commits intodevelopfrom
task/fix-scan-api

Conversation

@emilylaguna
Copy link
Copy Markdown
Contributor

@emilylaguna emilylaguna commented Dec 3, 2020

Description

This PR fixes some issues while parsing the scan data:

  • The Jetpack Scan credentials may not include all the fields so I made them optional
  • The context parsing was throwing when context: "" (context is an empty string)
  • isEnabled is always false because didSet is not called on initialization

You can test it using the following WPiOS PR: wordpress-mobile/WordPress-iOS#15427

Testing Details

Follow the testing steps on the PR here: wordpress-mobile/WordPress-iOS#15427

  • Please check here if your pull request includes additional test coverage.

public let port: Int?
public let user: String?
public let path: String?
public let type: String
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Are you sure these others will always be present? Just wondering if we shouldn't change them to Optionals too...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

From what I can tell the type, role, stillValid are always present.

@emilylaguna emilylaguna merged commit 3b8a13c into develop Dec 3, 2020
@emilylaguna emilylaguna deleted the task/fix-scan-api branch December 3, 2020 18:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants