Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support captureFeedback #2230

Open
wants to merge 35 commits into
base: main
Choose a base branch
from
Open

Support captureFeedback #2230

wants to merge 35 commits into from

Conversation

denrase
Copy link
Collaborator

@denrase denrase commented Aug 13, 2024

📜 Description

Implementation based on https://develop.sentry.dev/application/feedback-architecture/#feedback-events

💡 Motivation and Context

Relates to #1593

💚 How did you test it?

Unit tests

📝 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

🔮 Next steps

  • How can i test if the sent envelope is correct/expected on the server side?
    • Envelope sent through native sdks
      • iOS
      • macOS
      • Android
    • Envelope sent through http

Copy link
Contributor

github-actions bot commented Aug 13, 2024

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against f1a8281

Copy link

codecov bot commented Aug 13, 2024

Codecov Report

Attention: Patch coverage is 92.48555% with 13 lines in your changes missing coverage. Please review.

Project coverage is 88.12%. Comparing base (c26ba1d) to head (f1a8281).

Files with missing lines Patch % Lines
...utter/lib/src/feedback/sentry_feedback_widget.dart 95.91% 4 Missing ⚠️
dart/lib/src/hub.dart 80.00% 2 Missing ⚠️
dart/lib/src/hub_adapter.dart 0.00% 2 Missing ⚠️
dart/lib/src/noop_hub.dart 0.00% 2 Missing ⚠️
dart/lib/src/protocol/contexts.dart 90.00% 1 Missing ⚠️
dart/lib/src/protocol/sentry_feedback.dart 96.87% 1 Missing ⚠️
dart/lib/src/sentry.dart 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2230      +/-   ##
==========================================
+ Coverage   88.03%   88.12%   +0.08%     
==========================================
  Files         247      249       +2     
  Lines        8585     8751     +166     
==========================================
+ Hits         7558     7712     +154     
- Misses       1027     1039      +12     

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

Copy link
Contributor

github-actions bot commented Aug 13, 2024

iOS Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1252.79 ms 1273.06 ms 20.27 ms
Size 8.38 MiB 9.74 MiB 1.36 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
c3e6c82 1256.93 ms 1276.17 ms 19.24 ms
a7acb24 1296.71 ms 1317.69 ms 20.98 ms
280ab9f 1255.71 ms 1262.78 ms 7.06 ms
0be962b 1264.10 ms 1281.16 ms 17.06 ms
7f75f32 1230.80 ms 1251.79 ms 20.99 ms
014c3ea 1298.73 ms 1351.24 ms 52.51 ms
9811573 1259.78 ms 1278.33 ms 18.55 ms
b47809a 1252.61 ms 1278.57 ms 25.96 ms
f172c4d 1350.66 ms 1408.49 ms 57.83 ms
6f3717a 1259.84 ms 1280.90 ms 21.06 ms

App size

Revision Plain With Sentry Diff
c3e6c82 8.32 MiB 9.38 MiB 1.06 MiB
a7acb24 8.16 MiB 9.17 MiB 1.01 MiB
280ab9f 8.29 MiB 9.39 MiB 1.10 MiB
0be962b 8.10 MiB 9.16 MiB 1.07 MiB
7f75f32 8.28 MiB 9.33 MiB 1.05 MiB
014c3ea 8.33 MiB 9.39 MiB 1.06 MiB
9811573 8.16 MiB 9.17 MiB 1.01 MiB
b47809a 8.16 MiB 9.17 MiB 1.01 MiB
f172c4d 8.33 MiB 9.62 MiB 1.29 MiB
6f3717a 8.33 MiB 9.62 MiB 1.29 MiB

Previous results on branch: feat/capture-feedback

Startup times

Revision Plain With Sentry Diff
34b2626 1263.36 ms 1287.91 ms 24.55 ms
3114a70 1226.08 ms 1253.48 ms 27.40 ms
d5c1f0d 1231.00 ms 1244.22 ms 13.22 ms
4bb3ceb 1249.02 ms 1281.71 ms 32.69 ms
06a4a5f 1247.92 ms 1267.12 ms 19.21 ms
c86b10e 1254.92 ms 1269.71 ms 14.80 ms

App size

Revision Plain With Sentry Diff
34b2626 8.38 MiB 9.73 MiB 1.36 MiB
3114a70 8.38 MiB 9.74 MiB 1.36 MiB
d5c1f0d 8.38 MiB 9.71 MiB 1.33 MiB
4bb3ceb 8.38 MiB 9.71 MiB 1.33 MiB
06a4a5f 8.38 MiB 9.71 MiB 1.33 MiB
c86b10e 8.38 MiB 9.71 MiB 1.33 MiB

@ueman
Copy link
Collaborator

ueman commented Aug 13, 2024

I'm really looking forward to this, to use it in https://pub.dev/packages/feedback Thanks for tackling it!

@buenaflor
Copy link
Contributor

buenaflor commented Aug 13, 2024

@ueman on a side note, after this PR we are also looking into implementing the feedback widget

maybe it makes sense to adopt some code from your package? but let's see I haven't taken a deep dive yet into that

@denrase
Copy link
Collaborator Author

denrase commented Aug 13, 2024

@buenaflor I'm not sure if i have all the pieces in place that we need, would you mind taking a quick look over it and giving me feedback? /cc ueman

@ueman
Copy link
Collaborator

ueman commented Aug 13, 2024

@ueman on a side note, after this PR we are also looking into implementing the feedback widget

maybe it makes sense to adopt some code from your package? but let's see I haven't taken a deep dive yet into that

I would advise against using my package, at least as of know, as there are a couple of fundamental issues with it, that would require a lot of effort to fix. I would love to see those fixed though.

As for the (Sentry) feedback widget, there's already a very simple but working implementation at https://github.com/getsentry/sentry-dart/blob/main/flutter/example/lib/user_feedback_dialog.dart

With a bit of polishing (mainly around handling issues during sending the feedback, maybe UI adjustments), it should be quite easy to ship.

@buenaflor I'm not sure if i have all the pieces in place that we need, would you mind taking a quick look over it and giving me feedback? /cc ueman

Unfortunately, I also already failed once to implement this spec. So I'm afraid I can't really help here :/

@denrase
Copy link
Collaborator Author

denrase commented Aug 13, 2024

Ok, i can see the new feedback on sentry.io \o/

Bildschirmfoto 2024-08-13 um 16 45 21

@denrase
Copy link
Collaborator Author

denrase commented Aug 13, 2024

Seems to work fine on iOS, macOS and web. On Android i can see the envelope in Spotlight, but no new issue is appearing on sentry.io.

Bildschirmfoto 2024-08-13 um 17 32 01

Copy link
Contributor

github-actions bot commented Aug 19, 2024

Android Performance metrics 🚀

  Plain With Sentry Diff
Startup time 487.19 ms 536.04 ms 48.85 ms
Size 6.49 MiB 7.55 MiB 1.07 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
c328ffc 394.35 ms 480.94 ms 86.59 ms
5e8d2b3 342.17 ms 375.83 ms 33.66 ms
8d64376 302.88 ms 356.84 ms 53.96 ms
4477d2e 392.75 ms 472.69 ms 79.94 ms
9811573 309.76 ms 402.60 ms 92.84 ms
31b2afb 397.04 ms 475.09 ms 78.04 ms
d0312c9 354.78 ms 411.53 ms 56.75 ms
1c6eb5b 350.69 ms 393.86 ms 43.17 ms
2331d89 352.45 ms 417.34 ms 64.89 ms
7f2b01d 304.94 ms 345.71 ms 40.78 ms

App size

Revision Plain With Sentry Diff
c328ffc 6.35 MiB 7.42 MiB 1.07 MiB
5e8d2b3 6.15 MiB 7.13 MiB 1000.11 KiB
8d64376 5.94 MiB 6.96 MiB 1.02 MiB
4477d2e 6.33 MiB 7.26 MiB 950.38 KiB
9811573 5.94 MiB 6.96 MiB 1.02 MiB
31b2afb 6.34 MiB 7.28 MiB 966.36 KiB
d0312c9 6.33 MiB 7.26 MiB 949.76 KiB
1c6eb5b 5.94 MiB 6.92 MiB 1001.53 KiB
2331d89 5.94 MiB 6.96 MiB 1.02 MiB
7f2b01d 5.94 MiB 6.95 MiB 1.01 MiB

Previous results on branch: feat/capture-feedback

Startup times

Revision Plain With Sentry Diff
d5c1f0d 484.33 ms 580.04 ms 95.71 ms
4bb3ceb 416.62 ms 421.69 ms 5.07 ms
06a4a5f 416.80 ms 480.00 ms 63.20 ms
c86b10e 432.18 ms 491.02 ms 58.84 ms
34b2626 429.74 ms 486.14 ms 56.40 ms

App size

Revision Plain With Sentry Diff
d5c1f0d 6.52 MiB 7.59 MiB 1.06 MiB
4bb3ceb 6.52 MiB 7.59 MiB 1.06 MiB
06a4a5f 6.52 MiB 7.59 MiB 1.06 MiB
c86b10e 6.52 MiB 7.59 MiB 1.06 MiB
34b2626 6.52 MiB 7.61 MiB 1.09 MiB

@denrase
Copy link
Collaborator Author

denrase commented Aug 19, 2024

@buenaflor Could not figure out what the issue with Android is, other envelopes (errors/messages) get delivered.

@buenaflor
Copy link
Contributor

@denrase any signs of the event being rejected for some reason in logcat?

@denrase
Copy link
Collaborator Author

denrase commented Aug 21, 2024

@buenaflor I'm investigating the envelopes and there is not really a difference. Think we need someone from the backend team to help us out.

event_android.json
event_ios.json

@buenaflor
Copy link
Contributor

buenaflor commented Aug 27, 2024

I can confirm the envelope is being sent, could be a backend issue (or maybe it's a frontend issue)

Copy link
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.

overall looks good, just need to check why android is not being displayed

let's wait for some resolution on this before merging this

@buenaflor
Copy link
Contributor

according to @aliu39 this issue might be relevant, let's wait for it to be fixed and see if android is still not working

@aliu39
Copy link
Member

aliu39 commented Sep 3, 2024

@buenaflor Can you test again to see if it's showing up?

About the other issue - the search backend we rely on has a bug where a feedback will be dropped from the response. This happens very rarely, and when it does it's still returned by other endpoints, ex count. Have you noticed your inbox counts not matching the number of feedbacks in the list?

@buenaflor
Copy link
Contributor

cc @denrase can you try it out pls

# Conflicts:
#	dart/test/sentry_client_test.dart
@denrase
Copy link
Collaborator Author

denrase commented Sep 5, 2024

@aliu39 @buenaflor Still not seeing Feedback from Android. Web works, so the client should be doing everything as expected.

Bildschirmfoto 2024-09-05 um 10 16 30

@buenaflor
Copy link
Contributor

@aliu39 we believe its most likely an SDK internal issue, we'll investigate it

@denrase
Copy link
Collaborator Author

denrase commented Sep 11, 2024

@buenaflor Waiting for getsentry/sentry-java#3687

@denrase
Copy link
Collaborator Author

denrase commented Sep 17, 2024

@buenaflor getsentry/sentry-java#3687 was merged. Waiting for it beeing released, then we can finish here.

@ueman
Copy link
Collaborator

ueman commented Sep 18, 2024

Can't this be already merged? I mean the code works, and the Android dependency will be updated anyway as soon as it's release right?

@denrase
Copy link
Collaborator Author

denrase commented Sep 23, 2024

@ueman Think we could, but then we'd potentially block releases if Android takes longer than expected, no?

@denrase
Copy link
Collaborator Author

denrase commented Sep 23, 2024

@buenaflor What do you think? Should we merge this with the info that Android support will come later? Would be easier, as i have to merge in main every other day and fixing issues that arise.

@buenaflor
Copy link
Contributor

buenaflor commented Sep 25, 2024

@denrase I'll do a release soon, either today or tomorrow, we can merge it afterwards so we can wait for the android release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants