superwall / Superwall-iOS

Remotely configure every aspect of your paywall and double your revenue.
https://superwall.com
MIT License
86 stars 22 forks source link

fix(identity): dead lock when setting same user id #127

Closed gierschv closed 1 year ago

gierschv commented 1 year ago

Changes in this pull request

When calling Superwall.shared.identify(userId: "abc") when opening app instead of only during login, IdentityManager.didSetIdentity is never execute since the queue is stuck. Bug repro: set identity in AppDelegate and open app twice (works first time, fails afterwards).

This bug also blocks future calls to Superwall.shared.getPresentationResult that never returns since identityManager.hasIdentity is always false in AwaitIdentifyOperator, and never opens future paywalls.

Checklist

yusuftor commented 1 year ago

This is a real bug! Thanks for the detailed report and pull request. I've changed this to merge to our develop branch before we release to master with other upcoming fixes. We actually have some UITests (not included in this project), but we don't have a UITest that identifies with the same userId, so we'll add that in.