logIn/logOut: sync attributes before aliasing#1716
Conversation
There was a problem hiding this comment.
I was not feeling inspired yesterday, this needs a better name I think. Any suggestions?
There was a problem hiding this comment.
I would have made it even worse with AttributeSyncable so yeah, I've got nothing.
There was a problem hiding this comment.
It's an old habit but with interfaces/protocols when it adds some ability, I always add able to the end.
There was a problem hiding this comment.
This could use a better name too.
There was a problem hiding this comment.
What's wrong with logOut? I think it's ok.
There was a problem hiding this comment.
There are 2 logOut methods now. The internal one performs the sync first.
There was a problem hiding this comment.
Oooooo maybe rename internal to syncThenLogOut?
There was a problem hiding this comment.
I'm not a big fan of that cause that's exposing an implementation detail in the name :/
There was a problem hiding this comment.
Yeah, I'm on the fence, though. If it's internal, the naming actually serves to remind us why we have it. If it were public API I'd definitely say you're 100% correct.
There was a problem hiding this comment.
I see what you're saying.
It does feel weird for Purchases.logIn to call IdentityManager.syncAttributesAndLogIn() or something like that.
There was a problem hiding this comment.
Yeah, ultimately, I don't have a strong preference for non-public api naming here. What you have perform is totally workable IMO
logIn/logOut: fix: sync attributes before aliasinglogIn/logOut: sync attributes before aliasing
3dc7fa6 to
881e744
Compare
29ae241 to
45550c3
Compare
taquitos
left a comment
There was a problem hiding this comment.
Naming question, but otherwise looks ✅
Fixes [CSDK-36].
45550c3 to
f740fcb
Compare
### Changes: * Replaced `CustomerInfo.nonSubscriptionTransactions` with a new non-`StoreTransaction` type (#1733) via NachoSoto (@NachoSoto) * `Purchases.configure`: added overload taking a `Configuration.Builder` (#1720) via NachoSoto (@NachoSoto) * Extract Attribution logic out of Purchases (#1693) via Joshua Liebowitz (@taquitos) * Remove create alias (#1695) via Joshua Liebowitz (@taquitos) All attribution APIs can now be accessed from `Purchases.shared.attribution`. ### Improvements: * Improved purchasing logs, added promotional offer information (#1725) via NachoSoto (@NachoSoto) * `PurchasesOrchestrator`: don't log attribute errors if there are none (#1742) via NachoSoto (@NachoSoto) * `FatalErrorUtil`: don't override `fatalError` on release builds (#1736) via NachoSoto (@NachoSoto) * `SKPaymentTransaction`: added more context to warnings about missing properties (#1731) via NachoSoto (@NachoSoto) * New SwiftUI Purchase Tester example (#1722) via Josh Holtz (@joshdholtz) * update docs for `showManageSubscriptions` (#1729) via aboedo (@aboedo) * `PurchasesOrchestrator`: unify finish transactions between SK1 and SK2 (#1704) via NachoSoto (@NachoSoto) * `SubscriberAttribute`: converted into `struct` (#1648) via NachoSoto (@NachoSoto) * `CacheFetchPolicy.notStaleCachedOrFetched`: added warning to docstring (#1708) via NachoSoto (@NachoSoto) * Clear cached offerings and products after Storefront changes (2/4) (#1583) via Juanpe Catalán (@Juanpe) * `ROT13`: optimized initialization and removed magic numbers (#1702) via NachoSoto (@NachoSoto) ### Fixes: * `logIn`/`logOut`: sync attributes before aliasing (#1716) via NachoSoto (@NachoSoto) * `Purchases.customerInfo(fetchPolicy:)`: actually use `fetchPolicy` parameter (#1721) via NachoSoto (@NachoSoto) * `PurchasesOrchestrator`: fix behavior dealing with `nil` `SKPaymentTransaction.productIdentifier` during purchase (#1680) via NachoSoto (@NachoSoto) * `PurchasesOrchestrator.handlePurchasedTransaction`: always refresh receipt data (#1703) via NachoSoto (@NachoSoto)
Fixes CSDK-75.
Depends on #1715.