getsentry / sentry-dart

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

Cannot capture user feedback #2066

Closed martyfuhry closed 1 month ago

martyfuhry commented 1 month ago

Platform

Dart

Obfuscation

Disabled

Debug Info

Disabled

Doctor

[✓] Flutter (Channel stable, 3.19.1, on Pop!_OS 22.04 LTS
    6.8.0-76060800daily20240311-generic, locale en_US.UTF-8)
    • Flutter version 3.19.1 on channel stable at
      /home/martyfuhry/fvm/versions/3.19.1
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision abb292a07e (3 months ago), 2024-02-20 14:35:05
      -0800
    • Engine revision 04817c99c9
    • Dart version 3.3.0
    • DevTools version 2.31.1

[✓] Android toolchain - develop for Android devices (Android SDK version
    34.0.0-rc1)
    • Android SDK at /usr/local/lib/android/sdk
    • Platform android-34, build-tools 34.0.0-rc1
    • Java binary at: /usr/local/android-studio/jbr/bin/java
    • Java version OpenJDK Runtime Environment (build
      17.0.9+0-17.0.9b1087.7-11185874)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • Ubuntu clang version 14.0.0-1ubuntu1.1
    • cmake version 3.22.1
    • ninja version 1.10.1
    • pkg-config version 0.29.2

[✓] Android Studio (version 2023.2)
    • Android Studio at /usr/local/android-studio
    • Flutter plugin version 79.0.1
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build
      17.0.9+0-17.0.9b1087.7-11185874)

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Pop!_OS 22.04 LTS
      6.8.0-76060800daily20240311-generic
    • Chrome (web)    • chrome • web-javascript • Google Chrome
      124.0.6367.155

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

• No issues found!

Version

8.2.0

Steps to Reproduce

  1. Create a Sentry event and a SentryUserFeedback object with that event ID.
  2. Run captureUserFeedback
  3. The Sentry event shows up on the dashboard
  4. No user feedback ever shows up in the User Feedback dashboard
final sentryId = await Sentry.captureMessage(message);
final userFeedback = SentryUserFeedback(
  eventId: sentryId,
  comments: 'Some comments',
  name: 'Marty Fuhry',
  email: 'email@email.com',
);
await Sentry.captureUserFeedback(userFeedback);

Expected Result

User feedback shows up in the User Feedback list and the Sentry event has a corresponding User Feedback.

Actual Result

No User Feedback.

image

None on the issue either

image

Are you willing to submit a PR?

Yes

martyfuhry commented 1 month ago

Solved this. The issue was that SentryUserFeedback has required set for the event ID, but nullable fields for name, email, and comments. If any of those fields are null, though, the User Feedback object will never be created. The fix is to make sure those fields are not null when creating the object.

I would suggest making those fields required and removing the assert statement in that constructor.