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

[ABW-3847] Integrate sargon logic for security problems in Android wallet #1274

Merged

Conversation

giannis-rdx
Copy link
Contributor

Description

read this

How to test

  1. Create several security problems (e.g. cloud backup off and backup not updated)
  2. Ensure the security warnings are correct

PR submission checklist

  • I have tested several security problems.

)
}

sargonOsManager.sargonOs.checkSecurityProblems(
Copy link
Contributor

Choose a reason for hiding this comment

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

Both sargonOs getter and checkSecurityProblems method on it are throwing. Please ensure the exception is properly handled.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes good catch! thank you

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sergiupuhalschi-rdx what do you recommend about handling the exception?
adding a runCatching in the usecase and return Flow<Result<Set<SecurityProblem>>>
or adding a .catch { Timber.e("failed to get security problems...") } in the viewmodel where I collect the flows?

I’m leaning toward the second option, tbh.

Copy link
Contributor

Choose a reason for hiding this comment

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

If we should just propagate the error with no additional logic then catch looks like a better option. You might also consider adding catch inside the useCase instead of each viewModel using this useCase. Either option sounds good.

}.collect {}
}
.flowOn(defaultDispatcher)
.collect {}
Copy link
Contributor

Choose a reason for hiding this comment

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

To prevent unnecessary instantiating a FlowCollector, there is a collect method with no params.

@giannis-rdx giannis-rdx marked this pull request as ready for review December 9, 2024 11:04
Copy link
Contributor

@sergiupuhalschi-rdx sergiupuhalschi-rdx left a comment

Choose a reason for hiding this comment

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

Works fine!

unrecoverableEntities = findUnrecoverableEntities(entitiesWithSecurityPrompts),
withoutControlEntities = findWithoutControlEntities(entitiesWithSecurityPrompts),
lastCloudBackup = BackupResult(
saveIdentifier = "string",
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a dummy text because the field is only used by iOS? Maybe we'd benefit from having a comment here stating this if this is the case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

forgot to update this.
I will pass the google drive file id there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 40%)

See analysis details on SonarQube Cloud

@giannis-rdx giannis-rdx merged commit 4e9a45c into main Dec 10, 2024
9 of 10 checks passed
@giannis-rdx giannis-rdx deleted the feature/ABW-3847-integrate-sargon-logic-for-security-problems branch December 10, 2024 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants