Skip to content

Commit

Permalink
Fix DBP interrupt function not being cleared on succesful completion (#…
Browse files Browse the repository at this point in the history
…2690)

Task/Issue URL:
https://app.asana.com/0/1199230911884351/1207152863082294/f
Tech Design URL:
CC:

**Description**:
Straightforward, as title

**Steps to test this PR**:
1. test DBP still works
2. Test the various pixels still work as expected. Test the interrupt
pixel is called only when a function is actually interrupted
3. Test that an interrupt pixel and a completed successfully pixel are
never fired at the same time

<!--
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 5b32cfd commit 99408c1
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,11 @@ final class DataBrokerProtectionProcessor {
currentlyRunningOperationsForFunction = .startManualScans(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

0 comments on commit 99408c1

Please sign in to comment.