expo: Expo-segment-analytics Identify call have incorrect nested device info data

Summary

image

This is causing the payload to be incorrectly interpreted by cloud mode destinations like Mixpanel where that data is landing as unknown as it is in a nested object. These are being called with identifyWithTraits

The Android calls are working fine.

Managed or bare workflow? If you have ios/ or android/ directories in your project, the answer is bare!

managed

What platform(s) does this occur on?

iOS

SDK Version (managed workflow only)

42

Environment

Expo CLI 4.10.1 environment info: System: OS: macOS 11.5.1 Shell: 5.8 - /bin/zsh Binaries: Node: 14.17.4 - ~/.nvm/versions/node/v14.17.4/bin/node Yarn: 1.22.10 - /usr/local/bin/yarn npm: 7.20.3 - ~/.nvm/versions/node/v14.17.4/bin/npm SDKs: iOS SDK: Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4 Android SDK: API Levels: 30 Build Tools: 30.0.2 System Images: android-30 | Google APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom IDEs: Xcode: 12.5.1/12E507 - /usr/bin/xcodebuild npmPackages: expo: ^42.0.0 => 42.0.3 react: 16.13.1 => 16.13.1 react-dom: 16.13.1 => 16.13.1 react-native: https://github.com/expo/react-native/archive/sdk-42.0.0.tar.gz => 0.63.2 react-native-web: ~0.13.12 => 0.13.18 npmGlobalPackages: expo-cli: 4.10.1 Expo Workflow: managed

Reproducible demo or steps to reproduce from a blank project

Segment.identifyWithTraits(user.uid, { email: user.email })

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 2
  • Comments: 15 (11 by maintainers)

Most upvoted comments

I’m also having this issue on Expo 42.0.3, managed workflow.

It seems that this issue is being caused by hardcoded analytics-ios version 4.0.4 in ExSegment.podspec for ios:

https://github.com/expo/expo/blob/master/packages/expo-analytics-segment/ios/EXSegment.podspec#L5

This bug was fixed a while ago in analytics-ios 4.0.5 version:

https://github.com/segmentio/analytics-ios/blob/6e5dc12663a96081f375f11441f8d1a4def62aec/CHANGELOG.md#version-405-pre-release-28-august-2020

Could the version value be updated in expo-analytics-segment?

It would be good to make one more patch of expo-analytics-segment that fixes this issue, if all that’s needed is to bump up the version of the wrapped native SDK’s.

It’s not clear from the docs of @segment/analytics-react-native, but it seems like it may require migrating off the Expo managed workflow to the bare workflow, or to EAS build, is that correct?

From Cruzahs response https://github.com/expo/expo/issues/10088#issuecomment-956275538 it seems we can still use Expo Go, but I completely agree that the docs are not very clear about what can we use and how to use it on Expo.

FYI Segment has recently released a brand new react native library that is Expo-compatible, and it is likely that we will deprecate expo-analytics-segment in favor of their new library.

I recommend trying out this new library if you’re looking for the best Segment experience: https://github.com/segmentio/analytics-react-native/blob/master/README.md

Good find, do you mind expanding on why the hardcore version would nest the object?

It’s the analytics-ios package dependency which is causing the double nesting, this was fixed within 4.0.5 version, but the expo-analytics-segment still refers to 4.0.4 (which has that bug).