getsentry / sentry-dart

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

setUser `data` object values not visible in issue context #2068

Closed gaganyadav80 closed 1 month ago

gaganyadav80 commented 1 month ago

Platform

Flutter Mobile

Obfuscation

Disabled

Debug Info

Disabled

Doctor

Output ```bash [✓] Flutter (Channel stable, 3.19.3, on macOS 14.2.1 23C71 darwin-arm64, locale en-IN) • Flutter version 3.19.3 on channel stable at /Users/gagan/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision ba39319843 (3 months ago), 2024-03-07 15:22:21 -0600 • Engine revision 2e4ba9c6fb • Dart version 3.3.1 • DevTools version 2.31.1 [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at /Users/gagan/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.10+0-17.0.10b1087.21-11572160) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 15.3) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 15E204a • CocoaPods version 1.15.2 [✓] Android Studio (version 2023.3) • 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.10+0-17.0.10b1087.21-11572160) [✓] IntelliJ IDEA Community Edition (version 2023.3.3) • IntelliJ at /Applications/IntelliJ IDEA CE.app • 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 [✓] VS Code (version 1.89.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.88.0 [✓] Connected device (1 available) • iPhone 13 mini (mobile) • 62276C9F-290D-4CF0-A229-DDB85A9792F5 • ios • com.apple.CoreSimulator.SimRuntime.iOS-17-4 (simulator) ! Error: Browsing on the local area network for Gagan’s iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac. The device must be opted into Developer Mode to connect wirelessly. (code -27) [✓] Network resources • All expected network resources are available. • No issues found! ```

Version

8.2.0

Steps to Reproduce

Please note the extra property provided is only "Account ID", because in the Expected results screenshot "Username" and "IP Address" property is missing.

await Sentry.captureException(
  error,
  stackTrace: stackTrace,
  withScope: (Scope scope) async {
   await scope.setUser(
      scope.user?.copyWith(
        data: <String, String>{
          'Account ID': '3e61dc9b....',
        },
      ),
    );
  },
);

Expected Result

(This is from the older UI)

Screenshot 2024-04-10 at 12 35 30 - 2

Actual Result

(This is from the new UI with dark reader extension, hence the dark theme)

Screenshot 2024-05-22 at 13 26 09
JSON File for the issue (order is rearranged) ![Screenshot 2024-05-22 at 13 26 40](https://github.com/getsentry/sentry-dart/assets/47142137/46be873f-f6d8-4b26-8829-25c97fe1edd5)

Are you willing to submit a PR?

Yes

kahest commented 1 month ago

Hey @gaganyadav80 can you please clarify - how did you take the screenshot for the expected result? Are expected/actual 2 different events? If so, does the JSON data differ between the two?

gaganyadav80 commented 1 month ago

Hey @gaganyadav80 can you please clarify - how did you take the screenshot for the expected result? Are expected/actual 2 different events? If so, does the JSON data differ between the two?

Hi @kahest, I forgot to mention. I edited the HTML from browser's developer tools just to show how it should look. Both the screenshots are of the same event.

I am attaching a screenshot from the older UI which showed the data properties from the Sentry user object. This can also be considered as 'Expected Result'. As you can see in the screenshot the same account ID was visible in the older UI. I am also updating the same in the original post for better clarification.


Screenshot 2024-04-10 at 12 35 30 - 2
kahest commented 1 month ago

@gaganyadav80 thanks for the reply. Does it work if you change the key back from Account ID (as it is now) to accountId as it was previously?

gaganyadav80 commented 1 month ago

@kahest I can now see all the properties provided in the data object when I just checked. Both keys Account ID and accountId were visible when I tested.

We can consider this closed. Thank you for your time.