Skip to content

Commit

Permalink
DBP interrupt fixes for release (#2696)
Browse files Browse the repository at this point in the history
Task/Issue URL:
https://app.asana.com/0/1199230911884351/1207148631921399/f and
https://app.asana.com/0/1199230911884351/1207152863082294/f
Tech Design URL:
CC:

**Description**:
Combines #2685 and
#2690 to merge them into
an internal release

**Steps to test this PR**:
1. Follow the steps in the two individual PRs

<!--
Tagging instructions
If this PR isn't ready to be merged for whatever reason it should be
marked with the `DO NOT MERGE` label (particularly if it's a draft)
If it's pending Product Review/PFR, please add the `Pending Product
Review` label.

If at any point it isn't actively being worked on/ready for
review/otherwise moving forward (besides the above PR/PFR exception)
strongly consider closing it (or not opening it in the first place). If
you decide not to close it, make sure it's labelled to make it clear the
PRs state and comment with more information.
-->

---
###### Internal references:
[Pull Request Review
Checklist](https://app.asana.com/0/1202500774821704/1203764234894239/f)
[Software Engineering
Expectations](https://app.asana.com/0/59792373528535/199064865822552)
[Technical Design
Template](https://app.asana.com/0/59792373528535/184709971311943)
[Pull Request
Documentation](https://app.asana.com/0/1202500774821704/1204012835277482/f)
  • Loading branch information
THISISDINOSAUR authored Apr 24, 2024
1 parent bc1880e commit 68122b2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,11 @@ final class DataBrokerProtectionProcessor {
currentlyRunningOperationsForFunction = .runAllScanOperations(pendingCompletion: completion)
runOperations(operationType: .scan,
priorityDate: nil,
showWebView: showWebView) { errors in
showWebView: showWebView) { [weak self] errors in
os_log("Scans done", log: .dataBrokerProtection)
self?.currentlyRunningOperationsForFunction = nil
completion?(errors)
self.calculateMisMatches()
self?.calculateMisMatches()
}
}

Expand All @@ -88,8 +89,9 @@ final class DataBrokerProtectionProcessor {
currentlyRunningOperationsForFunction = .runAllOptOutOperations(pendingCompletion: completion)
runOperations(operationType: .optOut,
priorityDate: nil,
showWebView: showWebView) { errors in
showWebView: showWebView) { [weak self] errors in
os_log("Optouts done", log: .dataBrokerProtection)
self?.currentlyRunningOperationsForFunction = nil
completion?(errors)
}
}
Expand All @@ -100,8 +102,9 @@ final class DataBrokerProtectionProcessor {
currentlyRunningOperationsForFunction = .runQueuedOperations(pendingCompletion: completion)
runOperations(operationType: .all,
priorityDate: Date(),
showWebView: showWebView) { errors in
showWebView: showWebView) { [weak self] errors in
os_log("Queued operations done", log: .dataBrokerProtection)
self?.currentlyRunningOperationsForFunction = nil
completion?(errors)
}
}
Expand All @@ -112,8 +115,9 @@ final class DataBrokerProtectionProcessor {
currentlyRunningOperationsForFunction = .runAllOperations(pendingCompletion: completion)
runOperations(operationType: .all,
priorityDate: nil,
showWebView: showWebView) { errors in
showWebView: showWebView) { [weak self] errors in
os_log("Queued operations done", log: .dataBrokerProtection)
self?.currentlyRunningOperationsForFunction = nil
completion?(errors)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,9 @@ public final class DefaultDataBrokerProtectionScheduler: DataBrokerProtectionSch

self.startScheduler(showWebView: showWebView)

self.userNotificationService.sendFirstScanCompletedNotification()
if errors?.oneTimeError == nil {
self.userNotificationService.sendFirstScanCompletedNotification()
}

if let hasMatches = try? self.dataManager.hasMatches(),
hasMatches {
Expand Down

0 comments on commit 68122b2

Please sign in to comment.