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

Required field "abTestName" missing #84

Closed beweinreich closed 7 months ago

beweinreich commented 1 year ago

Description

Updated to latest v2.6.0. When I fetch a paywall with: adapty.getPaywall(paywallName) it throws an error.

 DEBUG  [2023-09-01T18:53:31.282Z] [adapty@2.4.6] "AdaptyPaywallCoder": Decoding string... {"json": {"data": {"ab_test_name": "converted / Premium", "developer_id": "premium", "paywall_name": "converted / Premium", "paywall_updated_at": 1693592782126, "products": [Array], "remote_config": [Object], "revision": 1, "use_paywall_builder": false, "variation_id": "e6b07e3e-fa3c-4544-9466-428d1600a610"}, "type": "AdaptyPaywall"}}
 DEBUG  [2023-09-01T18:53:31.282Z] [adapty@2.4.6] "BridgeError": Raised new BridgeError {"adapty_code": 2006, "detail": "", "message": "Failed to deserialize \"AdaptyPaywallCoder\" interface. Required field \"abTestName\" missing."}
 ERROR  [2023-09-01T18:53:31.282Z] [adapty@2.4.6] "AdaptyPaywallCoder": Decoding string: FAILED {"__stack__": [{"action": "CALL", "fn": "getPaywall", "payload": [Object]}, {"action": "BRIDGE", "fn": "bridgeCall", "payload": [Object]}, {"action": "BRIDGE", "done": true, "fn": "bridgeCall", "payload": [Object]}, {"action": "DECODE", "fn": "AdaptyPaywallCoder", "payload": [Object]}, {"action": "DECODE", "error": true, "fn": "AdaptyPaywallCoder", "payload": [Circular]}], "error": [Error: Failed to deserialize "AdaptyPaywallCoder" interface. Required field "abTestName" missing.]}
 DEBUG  [2023-09-01T18:53:31.283Z] [adapty@2.4.6] "BridgeError.nativeErr": Creating new BridgeError from native error... {"args": [Error: Failed to deserialize "AdaptyPaywallCoder" interface. Required field "abTestName" missing.]}
 ERROR  [2023-09-01T18:53:31.283Z] [adapty@2.4.6] "BridgeError.nativeErr": Failed to deserialize a native error message {"args": [Error: Failed to deserialize "AdaptyPaywallCoder" interface. Required field "abTestName" missing.]}
 DEBUG  [2023-09-01T18:53:31.283Z] [adapty@2.4.6] "BridgeError": Raised new BridgeError {"adapty_code": 0, "detail": "Check the logs for more details", "message": "Failed to deserialize a native error message"}
 DEBUG  [2023-09-01T18:53:31.283Z] [adapty@2.4.6] "getPaywall": Calling method: OK {"error": [Error: #0 (unknown): Failed to deserialize a native error message]}

Version

v2.6.0

What platforms are you seeing the problem on?

iOS

System info

System:
    OS: macOS 13.5.1
    CPU: (10) arm64 Apple M1 Max
    Memory: 7.13 GB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 14.18.1 - ~/.nvm/versions/node/v14.18.1/bin/node
    Yarn: 1.22.17 - ~/.nvm/versions/node/v14.18.1/bin/yarn
    npm: 8.11.0 - ~/.nvm/versions/node/v14.18.1/bin/npm
    Watchman: Not Found
  Managers:
    CocoaPods: 1.11.3 - /Users/bw/.rbenv/shims/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: 2021.2 AI-212.5712.43.2112.8815526
    Xcode: 14.3.1/14E300c - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.13 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.0.0 => 18.0.0 
    react-native: 0.69.4 => 0.69.4 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found
divanc commented 1 year ago

Hey! Thank you for sharing a problem! Gonna have a look as soon as I can, hopefully tonight!

divanc commented 1 year ago

@beweinreich, hello again!

While conducting some tests, I've noticed that this error message is not present in v2.6.0, while it exists in v2.4.8

I'm not very confident with how development bundle caching work, but have you tried restarting development server? Or maybe with start --reset-cache?