Skip to content

Fixed AttributionFetcher.adServicesToken hanging when called in simulator#2157

Merged
NachoSoto merged 3 commits into
mainfrom
ad-services-token-test
Dec 16, 2022
Merged

Fixed AttributionFetcher.adServicesToken hanging when called in simulator#2157
NachoSoto merged 3 commits into
mainfrom
ad-services-token-test

Conversation

@NachoSoto

@NachoSoto NachoSoto commented Dec 15, 2022

Copy link
Copy Markdown
Contributor

Fixes #2121 and CSDK-600.

Initially I wanted to check .toNot(beEmpty()), but at least locally it's throwing an error:

Error Domain=com.apple.ap.adservices.attributionError Code=2 "Error generating token" UserInfo={NSLocalizedDescription=Error generating token}

Which is AAAttributionError.Code.internalError.
At least we have some test coverage to see if in any combination of Xcode / iOS it hangs, as reported.

@NachoSoto NachoSoto added the test label Dec 15, 2022
@NachoSoto NachoSoto requested a review from a team December 15, 2022 17:23
See #2121 and [CSDK-600].

Initially I wanted to check `.toNot(beEmpty()`, but at least locally it's throwing an error:
> Error Domain=com.apple.ap.adservices.attributionError Code=2 "Error generating token" UserInfo={NSLocalizedDescription=Error generating token}

Which is `AAAttributionError.Code.internalError`.

At least we have some test coverage to see if in any combination of Xcode / iOS it hangs, as reported.
@NachoSoto NachoSoto force-pushed the ad-services-token-test branch from 79b8df4 to d56c81a Compare December 15, 2022 17:25
@NachoSoto

Copy link
Copy Markdown
Contributor Author

And looks like this fails in iOS 14 only:
Screenshot 2022-12-15 at 09 37 49

@NachoSoto

Copy link
Copy Markdown
Contributor Author

Perfect!

@NachoSoto

Copy link
Copy Markdown
Contributor Author

Tests pass!

@NachoSoto NachoSoto changed the title Added tests for AttributionFetcher.adServicesToken Fixed AttributionFetcher.adServicesToken hanging when called in simulator Dec 15, 2022
@NachoSoto

Copy link
Copy Markdown
Contributor Author

I'd file a Radar, but this looks fixed in iOS 15/16, so they're gonna close it as "fixed" anyway.

@NachoSoto NachoSoto merged commit 79e27f7 into main Dec 16, 2022
@NachoSoto NachoSoto deleted the ad-services-token-test branch December 16, 2022 16:54
@NachoSoto NachoSoto added the pr:fix A bug fix label Dec 20, 2022
NachoSoto pushed a commit that referenced this pull request Dec 21, 2022
**This is an automatic release.**

### Bugfixes
* `ErrorUtils.purchasesError(withUntypedError:)`: handle `PublicError`s
(#2165) via NachoSoto (@NachoSoto)
* Fixed race condition finishing `SK1` transactions (#2148) via
NachoSoto (@NachoSoto)
* `IntroEligibilityStatus`: added `CustomStringConvertible`
implementation (#2182) via NachoSoto (@NachoSoto)
* `BundleSandboxEnvironmentDetector`: fixed logic for `macOS` (#2176)
via NachoSoto (@NachoSoto)
* Fixed `AttributionFetcher.adServicesToken` hanging when called in
simulator (#2157) via NachoSoto (@NachoSoto)
### Other Changes
* `Purchase Tester`: added ability to purchase products directly with
`StoreKit` (#2172) via NachoSoto (@NachoSoto)
* `DNSChecker`: simplified `NetworkError` initialization (#2166) via
NachoSoto (@NachoSoto)
* `Purchases` initialization: refactor to avoid multiple concurrent
instances in memory (#2180) via NachoSoto (@NachoSoto)
* `Purchase Tester`: added button to clear messages on logger view
(#2179) via NachoSoto (@NachoSoto)
* `NetworkOperation`: added assertion to ensure that subclasses call
completion (#2138) via NachoSoto (@NachoSoto)
* `CacheableNetworkOperation`: avoid unnecessarily creating operations
for cache hits (#2135) via NachoSoto (@NachoSoto)
* `PurchaseTester`: fixed `macOS` support (#2175) via NachoSoto
(@NachoSoto)
* `IntroEligibilityCalculator`: added log including `AppleReceipt`
(#2181) via NachoSoto (@NachoSoto)
* `Purchase Tester`: fixed scene manifest (#2170) via NachoSoto
(@NachoSoto)
* `HTTPClientTests`: refactored to use `waitUntil` (#2168) via NachoSoto
(@NachoSoto)
* `Integration Tests`: split up tests in smaller files (#2158) via
NachoSoto (@NachoSoto)
* `StoreKitRequestFetcher`: removed unnecessary dispatch (#2152) via
NachoSoto (@NachoSoto)
* `Purchase Tester`: added companion `watchOS` app (#2140) via NachoSoto
(@NachoSoto)
* `StoreKit1Wrapper`: added warning if receiving too many updated
transactions (#2117) via NachoSoto (@NachoSoto)
* `StoreKitTestHelpers`: cleaned up unnecessary log (#2177) via
NachoSoto (@NachoSoto)
* `TrialOrIntroPriceEligibilityCheckerSK1Tests`: use `waitUntilValue`
(#2173) via NachoSoto (@NachoSoto)
* `DNSChecker`: added log with resolved host (#2167) via NachoSoto
(@NachoSoto)
* `MagicWeatherSwiftUI`: updated `README` to point to workspace (#2142)
via NachoSoto (@NachoSoto)
* `Purchase Tester`: fixed `.storekit` config file reference (#2171) via
NachoSoto (@NachoSoto)
* `Purchase Tester`: fixed error alerts (#2169) via NachoSoto
(@NachoSoto)
* `CI`: don't make releases until `release-checks` pass (#2162) via
NachoSoto (@NachoSoto)
* `Fastfile`: changed `match` to `readonly` (#2161) via NachoSoto
(@NachoSoto)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

App freezes on iOS 14.5 after calling enableAdServicesAttributionTokenCollection()

3 participants