Skip to content

Exposed SystemInfo.observerMode to simplify code#2064

Merged
NachoSoto merged 1 commit into
mainfrom
system-info-observer-mode
Nov 23, 2022
Merged

Exposed SystemInfo.observerMode to simplify code#2064
NachoSoto merged 1 commit into
mainfrom
system-info-observer-mode

Conversation

@NachoSoto

Copy link
Copy Markdown
Contributor

No description provided.

@NachoSoto NachoSoto merged commit bdebc85 into main Nov 23, 2022
@NachoSoto NachoSoto deleted the system-info-observer-mode branch November 23, 2022 17:22
NachoSoto added a commit that referenced this pull request Nov 23, 2022
**This is an automatic release.**

### Bugfixes
* Changed default `UserDefaults` from `.standard` to our own Suite
(#2046) via NachoSoto (@NachoSoto)
### Other Changes
* `Logging`: added log when configuring SDK in observer mode (#2065) via
NachoSoto (@NachoSoto)
* `PurchaseTesterSwiftUI`: added observer mode setting (#2052) via
NachoSoto (@NachoSoto)
* Exposed `SystemInfo.observerMode` to simplify code (#2064) via
NachoSoto (@NachoSoto)
* `Result.init(catching:)` with `async` method (#2060) via NachoSoto
(@NachoSoto)
* Updated schemes and project for Xcode 14.1 (#2081) via NachoSoto
(@NachoSoto)
* `PurchasesSubscriberAttributesTests`: simplified tests (#2056) via
NachoSoto (@NachoSoto)
* `DeviceCache`: removed `fatalError` for users not overriding
`UserDefaults` (#2079) via NachoSoto (@NachoSoto)
* `DeviceCache`: changed `NotificationCenter` observation to be received
on posting thread (#2078) via NachoSoto (@NachoSoto)
* `StoreKit1Wrapper`: added instance address when detecting transactions
(#2055) via NachoSoto (@NachoSoto)
* Fixed lint issues with `SwiftLint 0.5.0` (#2076) via NachoSoto
(@NachoSoto)
* `NSData+RCExtensionsTests`: improved errors (#2043) via NachoSoto
(@NachoSoto)
* `APITester`: fixed warning in `SubscriptionPeriodAPI` (#2054) via
NachoSoto (@NachoSoto)
* `Integration Tests`: always run them in random order locally (#2068)
via NachoSoto (@NachoSoto)

Co-authored-by: NachoSoto <ignaciosoto90@gmail.com>
NachoSoto added a commit that referenced this pull request Nov 28, 2022
I wrote all these to cover the change in #2063. I wrote a failing test that only passed with the change in #2063. However, when running that in SK1, that would fail.
With the change as suggested in #2063, the SK2 behavior would differ from SK1.

From the `Transaction.all` docs:
> This sequence returns the user’s transaction history current to the moment you access the sequence. The sequence emits a finite number of transactions. If the App Store processes new transactions for the user while you’re accessing this sequence, the new transactions appear in the transaction listener, updates.

So all these new tests verify the behavior of the SDK when encountering transactions created prior to initializing the SDK.

Depends on #2064 and #2066.
NachoSoto added a commit that referenced this pull request Dec 15, 2022
I wrote all these to cover the change in #2063. I wrote a failing test that only passed with the change in #2063. However, when running that in SK1, that would fail.
With the change as suggested in #2063, the SK2 behavior would differ from SK1.

From the `Transaction.all` docs:
> This sequence returns the user’s transaction history current to the moment you access the sequence. The sequence emits a finite number of transactions. If the App Store processes new transactions for the user while you’re accessing this sequence, the new transactions appear in the transaction listener, updates.

So all these new tests verify the behavior of the SDK when encountering transactions created prior to initializing the SDK.

Depends on #2064 and #2066.
NachoSoto added a commit that referenced this pull request Dec 15, 2022
)

See [TRIAGE-179].

I wrote all these to cover the change in #2063. I wrote a failing test
that only passed with the change in #2063. However, when running that in
SK1, that would fail.
With the change as suggested in #2063, the SK2 behavior would differ
from SK1.

From the `Transaction.all` docs:
> This sequence returns the user’s transaction history current to the
moment you access the sequence. The sequence emits a finite number of
transactions. If the App Store processes new transactions for the user
while you’re accessing this sequence, the new transactions appear in the
transaction listener, updates.

These new tests verify the behavior of the SDK when encountering
transactions created prior to initializing the SDK, and some made after
initialization.

Integration tests now are as follows:
- `BaseStoreKitIntegrationTests`
  - `StoreKit1IntegrationTests`
  - `StoreKit2IntegrationTests`
  - `BaseStoreKitObserverModeIntegrationTests`:
    - `StoreKit1ObserverModeIntegrationTests`
    - `StoreKit2ObserverModeIntegrationTests`
    - `StoreKit1ObserverModeWithExistingPurchasesTests`
    - `StoreKit2ObserverModeWithExistingPurchasesTests`

Depends on #2064, #2066, and #2134.

[TRIAGE-179]:
https://revenuecats.atlassian.net/browse/TRIAGE-179?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
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