[ABW-3490] Security problems refresh bug #1207
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Jira ticket: ABW-3490
Description
Solves the UI glitch caused by
problem5
showing up and disappearing during an instant.Notes
To reproduce the case easily, you can lower the retry backup interval to something like 5-10 seconds. Then, place the device in airplane mode and you will easily see the issue on any account at Home screen.
After doing so and adding some logs for the problems detected by the
SecurityCenterClient
, I could see the following 3 logs almost immediately every time the cloud backup was attempted:As you may see, the client is indicating two times there is no problem, before correctly indicating at last that wallet has
problem5
.The first empty result shows because when app tries to perform a new backup after a failing one, it deletes the existing one on UserDefaults storage. Then, the
SecurityCenterClient
was considering this not a problem, when the fact is that if iCloud sync is enabled and there is no cloud backup, then we should consider we have a problem. This was fixed here.The second empty result comes because after failing to backup, while we attempt to perform a backup we set User Defaults to have a result
BackupResult.Result.started
. Until now, this wasn't considered a failing state. However it must also be considered a failing state to avoid the glitch while the operation takes place. It makes logical sense to be considered a failure state since we don't have a backup at such moment. This was fixed here