Skip to content

Commit

Permalink
Fix PIR not building on xcode 16 (#3328)
Browse files Browse the repository at this point in the history
Task/Issue URL:
https://app.asana.com/0/1201037661562251/1208378563410288/f
Tech Design URL:
CC:

**Description**:
Very minor to fix an odd build quirk in the QueueManager

**Steps to test this PR**:
1. Check the tests run and PIR still works, otherwise nothing to really
test directly

<!--
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.
-->

**Definition of Done**:

* [ ] Does this PR satisfy our [Definition of
Done](https://app.asana.com/0/1202500774821704/1207634633537039/f)?

---
###### 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 Sep 23, 2024
1 parent 411c3ef commit 061b9c3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,20 @@ protocol DataBrokerProtectionOperationQueue {
var maxConcurrentOperationCount: Int { get set }
func cancelAllOperations()
func addOperation(_ op: Operation)
func addBarrierBlock(_ barrier: @escaping @Sendable () -> Void)
func addBarrierCompletionBlock(_ barrier: @escaping @Sendable () -> Void)
}

extension OperationQueue: DataBrokerProtectionOperationQueue {}
extension OperationQueue: DataBrokerProtectionOperationQueue {
/*
An unfortunute necessarity due to an issue with xcode 16 and building for Product Review Release
Originally we just used addBarrierBlock directly, but now it won't build as it says
the extension doesn't conform to the protocol
The docs however say the method signiture is unchanged, so we've decided to blame the build system
*/
func addBarrierCompletionBlock(_ barrier: @escaping @Sendable () -> Void) {
addBarrierBlock(barrier)
}
}

enum DataBrokerProtectionQueueMode {
case idle
Expand Down Expand Up @@ -232,7 +242,7 @@ private extension DefaultDataBrokerProtectionQueueManager {
return
}

operationQueue.addBarrierBlock { [weak self] in
operationQueue.addBarrierCompletionBlock { [weak self] in
let errorCollection = DataBrokerProtectionAgentErrorCollection(oneTimeError: nil, operationErrors: self?.operationErrorsForCurrentOperations())
completion?(errorCollection)
self?.resetModeAndClearErrors()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1373,7 +1373,7 @@ final class MockDataBrokerProtectionOperationQueue: DataBrokerProtectionOperatio
self.operations.append(op)
}

func addBarrierBlock(_ barrier: @escaping @Sendable () -> Void) {
func addBarrierCompletionBlock(_ barrier: @escaping @Sendable () -> Void) {
didCallAddBarrierBlockCount += 1
self.barrierBlock = barrier
}
Expand Down

0 comments on commit 061b9c3

Please sign in to comment.