-
-
Notifications
You must be signed in to change notification settings - Fork 276
Feat: Attachment Support #505
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
Conversation
Codecov Report
@@ Coverage Diff @@
## main #505 +/- ##
==========================================
+ Coverage 91.67% 91.77% +0.10%
==========================================
Files 70 73 +3
Lines 2318 2371 +53
==========================================
+ Hits 2125 2176 +51
- Misses 193 195 +2
Continue to review full report at Codecov.
|
|
This does not yet include offline caching of attachments. |
|
I think there's currently no way to add attachments which need to be awaited. E.g. files and paths. The others are theoretically good, though I expect in practice it's not because they need to be awaited previously. This is because the scope callback does not accept futures. |
what do you mean by that? |
not sure if I follow, what do you mean? I didn't review the PR yet so I miss context |
dart/lib/src/attachment_extensions/_io_attachment_extensions.dart
Outdated
Show resolved
Hide resolved
|
nice PR @ueman its a Draft but I already have a great feeling about that, thanks. |
|
we will talk about getsentry/sentry-java#1517 this week, depending of the output of the meeting, we can address this issue in this PR too |
You'll have to use async/await Sentry.configureScope((scope) async {
scope.addAttachment(await Attachment.fromFile(file));
}):in order to add an attachment from a file. Though the callback doesn't allow it IIRC. You have to do this instead: final attachment = await Attachment.fromFile(file);
Sentry.configureScope((scope) {
scope.addAttachment(attachment);
}):Same thing for I mean you can use it without, so it's not a blocker. |
|
spec https://develop.sentry.dev/sdk/features/#attachments |
See https://develop.sentry.dev/sdk/features/#attachments
|
|
Disclaimer: I didn't read/review the PR. Just wanted to throw in some challenges we learned since releasing the attachment API in some SDKs so far:
Ideas that could solve these cases ^ would be welcomed |
Flutter apps don't quit on uncaught exceptions in Dart, so this is a non issue. If an exception happens in the native part the Dart uncaught exception handler is never called at all I guess. We would need to sync the scope across SDKs for that.
No, though @marandaneto already raised this issue, too.
This is quite an interesting problem. It probably makes sense to use the native part, if the time it takes to call the native platform has a low enough latency.
I think you can use
|
that's right, could be worked on #194
indeed, the workaround in the symbol-collector right now would not be possible as
it'd be a workaround but that's not quite the same thing. |
philipphofmann
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't finish yet, will do another pass tomorrow.
|
consider adding a method called |
Just wanted to add a comment for this. Thanks @marandaneto 🚀 |
philipphofmann
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just found one more API issue.
|
@philipphofmann Just to be sure: |
Co-authored-by: Manoel Aranda Neto <[email protected]>
|
@ueman is it ready for final code review? @bruno-garcia or @philipphofmann will do it, thanks |
Yep, it's ready now. |
marandaneto
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
📜 Description
💡 Motivation and Context
Closes #289
💚 How did you test it?
📝 Checklist
🔮 Next steps