getsentry / sentry-dart

Sentry SDK for Dart and Flutter
https://sentry.io/for/flutter/
MIT License
725 stars 223 forks source link

Affected user metrics are off #2062

Closed ueman closed 1 week ago

ueman commented 1 month ago

Platform

Flutter Mobile

Obfuscation

Disabled

Debug Info

Disabled

Doctor

[!] Flutter (Channel [user-branch], 3.19.6, on macOS 14.4.1 23E224 darwin-arm64, locale en-DE)
    ! Flutter version 3.19.6 on channel [user-branch] at /Users/ueman/Developer/flutter
      Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
      If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/docs/get-started/install.
    ! Upstream repository unknown source is not a standard remote.
      Set environment variable "FLUTTER_GIT_URL" to unknown source to dismiss this error.
    • Framework revision 54e66469a9 (4 weeks ago), 2024-04-17 13:08:03 -0700
    • Engine revision c4cd48e186
    • Dart version 3.3.4
    • DevTools version 2.31.1
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/ueman/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15F31d
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)

[✓] VS Code (version 1.89.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.88.0

[✓] VS Code (version 1.89.1)
    • VS Code at /Library/Application Support/JamfAppInstallers/com.microsoft.VSCode/root/Visual Studio Code.app/Contents
    • Flutter extension version 3.88.0

[✓] Connected device (5 available)
    • sdk gphone64 arm64 (mobile)  • emulator-5554                        • android-arm64  • Android 14 (API 34) (emulator)
    • iPhone-GWTGT1UTPLJQ (mobile) • 00008030-000E4D310CD3402E            • ios            • iOS 17.5 21F79
    • iPhone 15 Pro Max (mobile)   • D9401E62-D08B-4628-A8D4-914E495C7B51 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-17-5 (simulator)
    • macOS (desktop)              • macos                                • darwin-arm64   • macOS 14.4.1 23E224 darwin-arm64
    • Chrome (web)                 • chrome                               • web-javascript • Google Chrome 124.0.6367.203

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

Version

8.0.0

Steps to Reproduce

Record an exception to Sentry

Expected Result

Affected user is 1

Actual Result

Affected user is 0

For whatever reason, all issues say that zero users are affected after upgrading to v8.

Screenshot 2024-05-15 at 20 38 23

Are you willing to submit a PR?

No

buenaflor commented 4 weeks ago

is that still the case?

just tried it out on android and ios (simple exception) and it successfully detects affected users

image
denrase commented 3 weeks ago

@buenaflor Any way to reproduce this?

buenaflor commented 3 weeks ago

haven't found so far, looks okay at least through the sample

denrase commented 3 weeks ago

Could not reproduce this. Triggered an error on both iOS and Android release builds. Was detected as the same user, as I had the same IP address on both devices.

@ueman What is the info about the user in your issues?

Bildschirmfoto 2024-06-04 um 15 04 35 Bildschirmfoto 2024-06-04 um 15 06 21

iOS Android

ueman commented 3 weeks ago

We have the reporting of the IP disabled Screenshot 2024-06-04 at 15 33 34

buenaflor commented 2 weeks ago

what does the json look like for your user?

we recently had a similar issue on native, maybe it applies here too

https://github.com/getsentry/sentry-docs/pull/8661/files

buenaflor commented 2 weeks ago

Seems like this pr is one of the root causes https://github.com/getsentry/sentry-dart/pull/1665

now that the ipAddress is set to auto by default the user is not null anymore, thus the loadcontexts integration won't be able to set the user info (specifically the id) from native: https://github.com/getsentry/sentry-dart/blob/main/flutter/lib/src/integrations/load_contexts_integration.dart#L113