Skip to content

fix: Show success message after feedback submission#3609

Open
denrase wants to merge 4 commits intomainfrom
feat/feedback-success-message
Open

fix: Show success message after feedback submission#3609
denrase wants to merge 4 commits intomainfrom
feat/feedback-success-message

Conversation

@denrase
Copy link
Copy Markdown
Collaborator

@denrase denrase commented Mar 30, 2026

📜 Description

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.

Success Message
Bildschirmfoto 2026-03-30 um 11 20 35

💡 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
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 30, 2026

Android Performance metrics 🚀

  Plain With Sentry Diff
Startup time 496.35 ms 485.24 ms -11.10 ms
Size 14.31 MiB 15.49 MiB 1.19 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
cfca825 417.36 ms 393.37 ms -23.99 ms
51520fc 351.89 ms 349.79 ms -2.10 ms
75284dc 512.39 ms 530.87 ms 18.48 ms
a909995 383.55 ms 370.78 ms -12.77 ms
f761369 462.73 ms 563.80 ms 101.06 ms
575ebaa 478.00 ms 585.76 ms 107.76 ms
a5b28db 383.85 ms 387.65 ms 3.80 ms
e5b87f8 371.22 ms 377.22 ms 6.00 ms
c8596a6 474.00 ms 492.96 ms 18.96 ms
79f6b41 469.66 ms 525.90 ms 56.24 ms

App size

Revision Plain With Sentry Diff
cfca825 14.09 MiB 15.28 MiB 1.19 MiB
51520fc 13.93 MiB 15.18 MiB 1.25 MiB
75284dc 13.93 MiB 14.93 MiB 1.00 MiB
a909995 14.09 MiB 15.28 MiB 1.19 MiB
f761369 6.54 MiB 7.70 MiB 1.16 MiB
575ebaa 6.54 MiB 7.69 MiB 1.15 MiB
a5b28db 13.93 MiB 15.18 MiB 1.25 MiB
e5b87f8 13.93 MiB 15.18 MiB 1.25 MiB
c8596a6 6.54 MiB 7.53 MiB 1015.27 KiB
79f6b41 6.54 MiB 7.69 MiB 1.15 MiB

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

Startup times

Revision Plain With Sentry Diff
04e57cb 364.44 ms 361.00 ms -3.44 ms

App size

Revision Plain With Sentry Diff
04e57cb 14.31 MiB 15.49 MiB 1.19 MiB

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 30, 2026

iOS Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1258.83 ms 1258.98 ms 0.15 ms
Size 5.73 MiB 6.17 MiB 455.48 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
51520fc 1253.87 ms 1254.87 ms 1.00 ms
0e2b9b0 1248.69 ms 1252.22 ms 3.54 ms
c8596a6 1234.11 ms 1241.19 ms 7.08 ms
bfabaf2 1251.72 ms 1253.38 ms 1.67 ms
29e8ebe 1260.46 ms 1262.60 ms 2.14 ms
1777727 1249.21 ms 1258.40 ms 9.18 ms
6b69699 1254.80 ms 1273.31 ms 18.52 ms
e3f3ea1 1262.83 ms 1264.83 ms 1.99 ms
827bf09 1261.86 ms 1276.41 ms 14.55 ms
944b773 1252.82 ms 1254.08 ms 1.27 ms

App size

Revision Plain With Sentry Diff
51520fc 5.53 MiB 5.96 MiB 443.39 KiB
0e2b9b0 5.73 MiB 6.17 MiB 453.79 KiB
c8596a6 7.86 MiB 9.44 MiB 1.58 MiB
bfabaf2 5.53 MiB 6.01 MiB 487.95 KiB
29e8ebe 5.53 MiB 6.01 MiB 488.12 KiB
1777727 5.73 MiB 6.17 MiB 453.78 KiB
6b69699 7.86 MiB 9.44 MiB 1.58 MiB
e3f3ea1 5.53 MiB 5.96 MiB 443.28 KiB
827bf09 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

App size

Revision Plain With Sentry Diff
04e57cb 5.73 MiB 6.17 MiB 455.48 KiB

@sentry
Copy link
Copy Markdown

sentry bot commented Mar 30, 2026

Sentry Build Distribution

App Name App ID Version Configuration Install Page
sentry_flutter_example io.sentry.flutter.sample 9.16.0 (1) Release Install Build

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 30, 2026

Codecov Report

❌ Patch coverage is 96.21212% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.04%. Comparing base (d1c191c) to head (034262c).

Files with missing lines Patch % Lines
...utter/lib/src/feedback/sentry_feedback_widget.dart 96.21% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3609      +/-   ##
==========================================
+ Coverage   88.12%   91.04%   +2.92%     
==========================================
  Files         304       95     -209     
  Lines       10372     3262    -7110     
==========================================
- Hits         9140     2970    -6170     
+ Misses       1232      292     -940     

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

Copy link
Copy Markdown

@cursor cursor bot left a comment

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.

if (mounted && _submitted) {
_dismiss(pendingAssociatedEventId: false);
}
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Success message shown even when feedback capture fails

Medium Severity

The _submit method shows the success UI and invokes onSubmitSuccess without checking whether _captureFeedback actually succeeded. captureFeedback on the hub returns SentryId.empty() when the instance is disabled or when capture throws an exception. The established SDK pattern (visible in example_web/web/main.dart) is to check sentryId != SentryId.empty() before treating a capture as successful. Without this guard, users see "Thank you for your report!" and the onSubmitSuccess callback fires even when their feedback was silently dropped.

Fix in Cursor Fix in Web

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The problem is, that we effectively do not get negative. We send an envelope to JS/Android/iOS downstream SDK. The modal is closed in any case.


if (!mounted) return;

widget.options.onSubmitSuccess?.call(feedback, sentryId);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The onSubmitSuccess callback is invoked and the success UI is shown even when feedback submission fails, as there is no check for a returned SentryId.empty().
Severity: MEDIUM

Suggested Fix

Check the sentryId returned from _captureFeedback. Only call onSubmitSuccess and set the state to _submitted = true if the sentryId is not equal to SentryId.empty(). Consider handling the failure case, for example by not indicating success.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: packages/flutter/lib/src/feedback/sentry_feedback_widget.dart#L442

Potential issue: The `_captureFeedback` function can return `SentryId.empty()` if the
feedback event is dropped for various reasons, such as by a `beforeSendFeedback`
callback or a transport failure. The code unconditionally calls the `onSubmitSuccess`
callback and updates the UI to a success state immediately after `_captureFeedback`
returns, without checking the validity of the returned `sentryId`. This misleads both
the developer using the callback and the end-user, as they are informed of a success
when the submission may have actually failed.

Did we get this right? 👍 / 👎 to inform future reviews.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The problem is, that we effectively do not get negative. We send an envelope to JS/Android/iOS downstream SDK. The modal is closed in any case.

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 can you check if captureEnvelope in the native sdks returned an empty id if that equals to sending failed?

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.

for JS it's a bit trickier yea, afaict their sendEnvelope doesn't return any id

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

they do not, we get a valid id. initially i also had onError callbacks in this pr, but i abandoned them because of this behaviour

Copy link
Copy Markdown
Contributor

@buenaflor buenaflor left a comment

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
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