adaptyteam / AdaptySDK-React-Native

React Native SDK for growing in-app subscriptions
https://docs.adapty.io/docs/quickstart
MIT License
122 stars 12 forks source link

Issue with remoteConfigs (localization + legacy) for updating users #77

Closed snake302 closed 4 months ago

snake302 commented 1 year ago

Description

Hello! We are currently investigating an issue, which is as follows:

We have a paywall named test_1, which contains two identical remoteConfigs - one in With Localization (en default) and the other in Without Localization. The configs are 100% identical and valid.

We have another paywall named test_2, which contains one remoteConfig in With Localization (en default), identical to the two configs from test_1.

The problem is:

We have the first version of the app 1.0.0 (using "react-native-adapty": "2.2.1"), which works only with paywall test_1 and Legacy Without Localization Remote Config. Upon updating the app to version 1.0.1 (which uses "react-native-adapty": "2.4.6") and requesting paywall test_1 (getPaywall, locale en) - the remote config does not come through. However, when requesting paywall test_2 (getPaywall, locale en) - the remote config comes through, and everything works.

If we install version 1.0.1 from scratch and request paywall test_1 (getPaywall, locale en) - the remote config comes through.

It seems that there is some issue with the paywall that was on the legacy remote config and the app transitioning from an older version of React Native to a newer one, where the paywall now utilizes a remote config with locale.

Version

v2.4.6

What platforms are you seeing the problem on?

iOS

System info

System:
    OS: macOS 13.4
    CPU: (8) arm64 Apple M1
    Memory: 49.70 MB / 8.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.1.0 - /var/folders/vg/cv8q3tzj1hdfjfd7t0v26vd80000gn/T/yarn--1686898500765-0.8989131801691097/node
    Yarn: 1.22.17 - /var/folders/vg/cv8q3tzj1hdfjfd7t0v26vd80000gn/T/yarn--1686898500765-0.8989131801691097/yarn
    npm: 9.6.4 - /opt/homebrew/bin/npm
    Watchman: 2023.05.08.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.12.1 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4
    Android SDK: Not Found
  IDEs:
    Android Studio: Not Found
    Xcode: 14.3/14E222b - /usr/bin/xcodebuild
  Languages:
    Java: Not Found
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.1.0 => 18.1.0 
    react-native: 0.70.6 => 0.70.6 
    react-native-macos: Not Found
snake302 commented 1 year ago

Also while adding config to Localization (en) from Legacy I have unchecked checkbox "save as new version" due not to lost metrics for our current paywall.

snake302 commented 1 year ago

So yeah, we figured the issue, if you uncheck "save as new version" while adding a first version of localized paywall — localized config will return null for people who was on legacy config

divanc commented 1 year ago

Hi! We were releasing UI library and now we're back! Diving into your question...

divanc commented 1 year ago

@snake302 So far, I was unable to get null (or any unexpected) value in our setup. Let me review how you see this problem:

  1. You've created a paywall with a legacy config
  2. You've added a localized config without bumping a paywall version. You also haven't deleted legacy config, so they both exist in paywall
  3. In your app with newer SDK version (2.4.6) it causes config to return a nullable value instead of what you have set in a localized config field

Is that it? You also opened your issue as an iOS problem — is this not a case with android or you just haven't tried that one?

snake302 commented 1 year ago

@divanc Hey, thanks, here is the flow:

  1. App is installed and launched with Adapty SDK 2.2.1 with legacy paywall config
  2. I have added a localized config without bumping a paywall version. Also I haven't deleted legacy config, so they both exist in paywall, and they are the same
  3. We launch the new app version with SDK 2.4.6 (where localized paywall is now supported) and this user is facing null config.

So the main condition is update form version where localized paywall were not supported, this issues facing only old users

We don't have Android, so not sure about that.

divanc commented 1 year ago

We currently have a clue about the origin of this problem, allow me a little more time to confirm our suspicion.

divanc commented 1 year ago

Yeah, I'm afraid it is a problem with diffing paywall hashes across versions. It is a backend/native problem, so it requires a little more time to repair.

I'll try to force this issue asap and will write you back, when native SDK will be ready to provide a fix to us

Thank you for noticing this problem!