Skip to content

fix(feedback): Show success message after feedback submission#3609

Merged
denrase merged 18 commits into
mainfrom
feat/feedback-success-message
Apr 22, 2026
Merged

fix(feedback): Show success message after feedback submission#3609
denrase merged 18 commits into
mainfrom
feat/feedback-success-message

Conversation

@denrase

@denrase denrase commented Mar 30, 2026

Copy link
Copy Markdown
Collaborator

📜 Description

Display a success snackbar with successMessageText after feedback is submitted. Adds successColor and onSubmitSuccess callback to SentryFeedbackOptions.

Success Snackbar
Screenshot_1776086069

💡 Motivation and Context

Closes #3583

💚 How did you test it?

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPii is enabled
  • I updated the docs if needed
  • All tests passing
  • No breaking changes

denrase added 2 commits March 30, 2026 11:20
Display a success screen with successMessageText after feedback is submitted. The form is replaced with a checkmark icon and success message that auto-dismisses after 5 seconds or on tap. Adds `successColor` and `onSubmitSuccess` callback to `SentryFeedbackOptions`.
@denrase
denrase marked this pull request as ready for review March 30, 2026 09:23
@denrase
denrase requested a review from buenaflor as a code owner March 30, 2026 09:23
@github-actions

github-actions Bot commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

Android Performance metrics 🚀

  Plain With Sentry Diff
Startup time 432.49 ms 437.32 ms 4.83 ms
Size 14.31 MiB 15.49 MiB 1.19 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
bfabaf2 408.04 ms 444.38 ms 36.34 ms
4ff8a1b 378.32 ms 381.29 ms 2.97 ms
a5b28db 383.85 ms 387.65 ms 3.80 ms
13b8895 372.91 ms 370.13 ms -2.79 ms
b4b7781 399.82 ms 394.26 ms -5.56 ms
819c1e7 449.80 ms 442.98 ms -6.82 ms
7b21e8b 467.74 ms 466.24 ms -1.50 ms
2b5e090 437.21 ms 467.14 ms 29.93 ms
7cfbbd6 499.69 ms 592.24 ms 92.55 ms
93b7728 475.28 ms 489.13 ms 13.86 ms

App size

Revision Plain With Sentry Diff
bfabaf2 13.93 MiB 15.06 MiB 1.13 MiB
4ff8a1b 13.93 MiB 15.18 MiB 1.25 MiB
a5b28db 13.93 MiB 15.18 MiB 1.25 MiB
13b8895 13.93 MiB 15.18 MiB 1.25 MiB
b4b7781 14.31 MiB 15.49 MiB 1.19 MiB
819c1e7 13.93 MiB 15.00 MiB 1.06 MiB
7b21e8b 13.93 MiB 15.00 MiB 1.06 MiB
2b5e090 13.93 MiB 15.06 MiB 1.13 MiB
7cfbbd6 6.54 MiB 7.70 MiB 1.17 MiB
93b7728 6.54 MiB 7.69 MiB 1.15 MiB

Previous results on branch: feat/feedback-success-message

Startup times

Revision Plain With Sentry Diff
0aa509a 377.57 ms 393.20 ms 15.63 ms
f289ae3 496.35 ms 485.24 ms -11.10 ms
ec17daf 403.04 ms 422.15 ms 19.10 ms
0c7df23 379.69 ms 379.08 ms -0.61 ms
04e57cb 364.44 ms 361.00 ms -3.44 ms

App size

Revision Plain With Sentry Diff
0aa509a 14.31 MiB 15.49 MiB 1.19 MiB
f289ae3 14.31 MiB 15.49 MiB 1.19 MiB
ec17daf 14.31 MiB 15.49 MiB 1.19 MiB
0c7df23 14.31 MiB 15.49 MiB 1.19 MiB
04e57cb 14.31 MiB 15.49 MiB 1.19 MiB

@github-actions

github-actions Bot commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

iOS Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1258.70 ms 1262.96 ms 4.26 ms
Size 5.73 MiB 6.17 MiB 453.61 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
3f47ea3 1263.90 ms 1263.87 ms -0.02 ms
67de70c 1260.09 ms 1266.79 ms 6.71 ms
40c8f93 1234.27 ms 1261.98 ms 27.71 ms
0e2b9b0 1248.69 ms 1252.22 ms 3.54 ms
a7f011a 1247.40 ms 1255.72 ms 8.32 ms
e5ae2a6 1240.48 ms 1253.26 ms 12.78 ms
d789735 1240.58 ms 1246.41 ms 5.82 ms
7cfbbd6 1270.63 ms 1285.36 ms 14.72 ms
6b69699 1254.80 ms 1273.31 ms 18.52 ms
944b773 1252.82 ms 1254.08 ms 1.27 ms

App size

Revision Plain With Sentry Diff
3f47ea3 5.53 MiB 5.96 MiB 444.81 KiB
67de70c 5.73 MiB 6.17 MiB 455.45 KiB
40c8f93 5.53 MiB 6.00 MiB 479.94 KiB
0e2b9b0 5.73 MiB 6.17 MiB 453.79 KiB
a7f011a 5.73 MiB 6.17 MiB 455.50 KiB
e5ae2a6 5.65 MiB 6.09 MiB 446.96 KiB
d789735 5.53 MiB 5.96 MiB 443.28 KiB
7cfbbd6 7.86 MiB 9.44 MiB 1.58 MiB
6b69699 7.86 MiB 9.44 MiB 1.58 MiB
944b773 5.53 MiB 6.00 MiB 479.98 KiB

Previous results on branch: feat/feedback-success-message

Startup times

Revision Plain With Sentry Diff
04e57cb 1246.67 ms 1248.35 ms 1.67 ms
0aa509a 1248.27 ms 1256.28 ms 8.01 ms
ec17daf 1242.74 ms 1252.36 ms 9.62 ms
0c7df23 1259.98 ms 1268.59 ms 8.61 ms
f289ae3 1258.83 ms 1258.98 ms 0.15 ms

App size

Revision Plain With Sentry Diff
04e57cb 5.73 MiB 6.17 MiB 455.48 KiB
0aa509a 5.73 MiB 6.17 MiB 455.85 KiB
ec17daf 5.73 MiB 6.17 MiB 455.86 KiB
0c7df23 5.73 MiB 6.17 MiB 455.86 KiB
f289ae3 5.73 MiB 6.17 MiB 455.48 KiB

@sentry

sentry Bot commented Mar 30, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
sentry_flutter_example io.sentry.flutter.sample 9.18.0 (1) Release

⚙️ sentry-flutter Build Distribution Settings

@codecov

codecov Bot commented Mar 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.85039% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.49%. Comparing base (4d5fd7f) to head (779b6f9).
⚠️ Report is 7 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...utter/lib/src/feedback/sentry_feedback_widget.dart 96.85% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3609      +/-   ##
==========================================
+ Coverage   86.85%   91.49%   +4.64%     
==========================================
  Files         321      102     -219     
  Lines       10802     3494    -7308     
==========================================
- Hits         9382     3197    -6185     
+ Misses       1420      297    -1123     
Flag Coverage Δ
sentry ?
sentry_dio ?
sentry_drift ?
sentry_file ?
sentry_firebase_remote_config 100.00% <ø> (ø)
sentry_flutter 91.05% <96.85%> (+0.04%) ⬆️
sentry_hive ?
sentry_isar ?
sentry_link ?
sentry_logging ?
sentry_sqflite ?
sentry_supabase 97.27% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment thread packages/flutter/lib/src/feedback/sentry_feedback_widget.dart Outdated
Comment thread packages/flutter/lib/src/feedback/sentry_feedback_widget.dart Outdated

@buenaflor buenaflor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@denrase PTAL at AI review first

@denrase
denrase requested a review from buenaflor March 31, 2026 14:21
Comment thread packages/flutter/lib/src/feedback/sentry_feedback_widget.dart
Comment thread packages/flutter/lib/src/feedback/sentry_feedback_widget.dart

@buenaflor buenaflor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as discussed let's do that but let's make the out of the box success widget not the whole screen, please look into what's idiomatic for Flutter

@denrase
denrase requested a review from buenaflor April 13, 2026 13:19

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Autofix Details

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Unguarded user callback blocks dismiss and snackbar
    • Wrapped onSubmitSuccess in try-catch with error logging so callback failures no longer prevent showing the success snackbar and dismissing the widget.

Create PR

Or push these changes by commenting:

@cursor push 0e775e1fba
Preview (0e775e1fba)
diff --git a/packages/flutter/lib/src/feedback/sentry_feedback_widget.dart b/packages/flutter/lib/src/feedback/sentry_feedback_widget.dart
--- a/packages/flutter/lib/src/feedback/sentry_feedback_widget.dart
+++ b/packages/flutter/lib/src/feedback/sentry_feedback_widget.dart
@@ -8,6 +8,7 @@
 import 'package:flutter/services.dart';
 import 'sentry_logo.dart';
 import '../replay/integration.dart';
+import '../utils/internal_logger.dart';
 
 class SentryFeedbackWidget extends StatefulWidget {
   SentryFeedbackWidget({
@@ -388,7 +389,15 @@
 
     if (!mounted) return;
 
-    widget.options.onSubmitSuccess?.call(feedback, sentryId);
+    try {
+      widget.options.onSubmitSuccess?.call(feedback, sentryId);
+    } catch (exception, stackTrace) {
+      internalLogger.error(
+        'SentryFeedbackWidget failed to execute onSubmitSuccess callback',
+        error: exception,
+        stackTrace: stackTrace,
+      );
+    }
     _showSuccessSnackBar();
     _dismiss(pendingAssociatedEventId: false);
   }

diff --git a/packages/flutter/test/feedback/sentry_feedback_widget_test.dart b/packages/flutter/test/feedback/sentry_feedback_widget_test.dart
--- a/packages/flutter/test/feedback/sentry_feedback_widget_test.dart
+++ b/packages/flutter/test/feedback/sentry_feedback_widget_test.dart
@@ -889,6 +889,31 @@
         expect(receivedEventId, isNotNull);
         expect(receivedEventId, isNot(const SentryId.empty()));
       });
+
+      testWidgets('dismisses and shows snackbar when onSubmitSuccess throws',
+          (tester) async {
+        fixture.options.feedback.onSubmitSuccess = (feedback, eventId) {
+          throw Exception('onSubmitSuccess failed');
+        };
+
+        await fixture.pumpFeedbackHost(tester);
+
+        await tester.tap(find.text('Show Feedback'));
+        await tester.pumpAndSettle();
+
+        await tester.enterText(
+          find.byKey(const ValueKey('sentry_feedback_message_textfield')),
+          'callback-throw-test',
+        );
+        await tester.tap(find.text('Send Bug Report'));
+        await tester.pumpAndSettle();
+
+        expect(tester.takeException(), isNull);
+        expect(find.byType(SentryFeedbackWidget), findsNothing);
+        expect(find.byType(SnackBar), findsOneWidget);
+        expect(find.text('Thank you for your report!'), findsOneWidget);
+        expect(SentryFeedbackWidget.pendingAssociatedEventId, isNull);
+      });
     });
   });
 }

This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

Comment thread packages/flutter/lib/src/feedback/sentry_feedback_widget.dart

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 0aa509a. Configure here.

Comment thread packages/flutter/lib/src/feedback/sentry_feedback_widget.dart Outdated
@buenaflor buenaflor changed the title fix: Show success message after feedback submission fix(feedback): Show success message after feedback submission Apr 14, 2026
@github-actions

github-actions Bot commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


Fixes

  • (feedback) Show success message after feedback submission by denrase in #3609

🤖 This preview updates automatically when you update the PR.

Comment thread CHANGELOG.md
Comment thread packages/flutter/lib/src/feedback/sentry_feedback_widget.dart Outdated
@denrase
denrase requested a review from buenaflor April 17, 2026 08:22
Comment thread packages/flutter/lib/src/feedback/sentry_feedback_widget.dart
@denrase
denrase enabled auto-merge (squash) April 17, 2026 08:57

@buenaflor buenaflor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good 👍

pls also prepare a sentry-docs PR update so we dont forget

@denrase
denrase merged commit 832169f into main Apr 22, 2026
59 checks passed
@denrase
denrase deleted the feat/feedback-success-message branch April 22, 2026 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feedback successMessageText never shown

2 participants