adaptyteam / AdaptySDK-Flutter

SDK for growing mobile in-app purchases
https://docs.adapty.io/docs/quickstart
MIT License
88 stars 15 forks source link

The user profile was replaced #80

Closed ahmdt closed 1 year ago

ahmdt commented 1 year ago

Hi, the following error occurs when i want to identify an user after login or token refresh.

Adapty().activate();
await Adapty().setLogLevel(AdaptyLogLevel.verbose);
...
await Adapty().identify(action.account.id);

The identify() Method never resolves and freezes the app. Sometimes i see this error output:

Performing hot reload...
Syncing files to device iPhone SE (3rd generation)...
Reloaded 1 of 1367 libraries in 430ms (compile: 27 ms, reload: 149 ms, reassemble: 238 ms).
flutter: [AdaptyFlutter v2.2.4] - VERBOSE: --> Adapty.identify()
flutter: [AdaptyFlutter v2.2.4] - VERBOSE: <-- Adapty.identify() Adapty Error (code: 3006, message: The user profile was replaced, detail: AdaptyError.profileWasChanged([2.2.2]: Adapty/Adapty+ChangeState.swift#150))
x401om commented 1 year ago

Hi, @tonbert!

This error can occur when you run a parallel identify process and another one that depends on the user's profile. If during the identify process the profile has changed, this error will be returned for the rest of the requests, in which case you need to retry the request.

ahmdt commented 1 year ago

ok, it works, thank you