Skip to content

PurchasesOrchestrator.handleDeferredTransaction: check NSError.domain too#1665

Merged
NachoSoto merged 2 commits into
mainfrom
purchases-orchestrator-error-cancelled
Jun 7, 2022
Merged

PurchasesOrchestrator.handleDeferredTransaction: check NSError.domain too#1665
NachoSoto merged 2 commits into
mainfrom
purchases-orchestrator-error-cancelled

Conversation

@NachoSoto

Copy link
Copy Markdown
Contributor

Comparing only error codes can lead to collisions with a completely different error.
Also refactored this check into an existing extension.

@NachoSoto NachoSoto requested a review from a team June 7, 2022 18:06
@NachoSoto NachoSoto force-pushed the purchases-orchestrator-error-cancelled branch from cfd0ee2 to 85d3db1 Compare June 7, 2022 18:07
@NachoSoto NachoSoto force-pushed the purchases-orchestrator-atomic branch from 86c2abb to 2ed8c36 Compare June 7, 2022 19:15
@NachoSoto NachoSoto force-pushed the purchases-orchestrator-error-cancelled branch from 85d3db1 to 59f6c28 Compare June 7, 2022 19:15
See #983. This is less error-prone as it's impossible to have deadlocks, or to access the data without locking (like we were doing in some cases).
Also, this approach has 2 separate locks for each property, so unrelated accesses won't lock each other now.
@NachoSoto NachoSoto force-pushed the purchases-orchestrator-atomic branch from 2ed8c36 to 2bd983c Compare June 7, 2022 19:21
…ain` too

Comparing only error codes can lead to collisions with a completely different error.
Also refactored this check into an existing extension.

@taquitos taquitos left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎈🐐

} else {
userCancelled = false
}
let userCancelled = transaction.error?.isCancelledError ?? false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

FINE make it a single line that reads better 😄

Base automatically changed from purchases-orchestrator-atomic to main June 7, 2022 22:09
@NachoSoto NachoSoto merged commit 1674d96 into main Jun 7, 2022
@NachoSoto NachoSoto deleted the purchases-orchestrator-error-cancelled branch June 7, 2022 22:10
@NachoSoto NachoSoto mentioned this pull request Jun 7, 2022
NachoSoto added a commit that referenced this pull request Jun 7, 2022
_This version supports Xcode 14 beta 1_

* `PurchasesOrchestrator.handleDeferredTransaction`: check `NSError.domain` too (#1665) via NachoSoto (@NachoSoto)
* `PurchasesOrchestrator`: replaced manual `Lock` with `Atomic` (#1664) via NachoSoto (@NachoSoto)
* `CodableStrings.decoding_error`: added underlying error information (#1668) via NachoSoto (@NachoSoto)
* Fixed Xcode 14 compilation: avoid `@available` properties (#1661) via NachoSoto (@NachoSoto)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants