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

Adding support to send screenshot to sentry event logging #20

Merged
merged 1 commit into from
Jan 29, 2024

Conversation

mikeesouth
Copy link

I've tested that this works for Android and I'm assuming iOS too. Sentry does not support screenshots in web and neither does catcher_2. Because of this we can use the regular dart:io File to parse the screenshot data and send it to Sentry.

@ThexXTURBOXx
Copy link
Owner

Thank you for the contribution!
However, I am currently sick and not able to work on this for the coming days, sorry. I suspect that the current code will not compile on Web due to the dart:io import.
It might be nice if you could test that. Else, I will test when I am healthy again :)

@mikeesouth
Copy link
Author

Happy to help out! Good question but as far as I know the dart:io import in itself is not a problem for web platforms, using (most of the) stuff in the dart:io in web is a problem. I added a comment about this and also have a condition on !kIsWeb. I've tested this in web projects and it works just fine 👍

No rush in merging this for my sake even though I would appreciate it being added to the catcher_2 library of course. I will be using my own fork until catcher_2 has support for cleaning up screenshots after they have been submitted to all the registered handlers. Maybe I will submit that, maybe you have ideas or maybe some other kind soul out there. I'm worried that a device with multiple errors could quickly build up quite much storage space in form of error screenshots. Even if I use a temporary folder for the screenshots, I feel that it's important to cleanup the screenshot after it's been submitted. I mentioned this in #19 but my quick fix is to delete the screenshot in the sentry_handler and that will remove the file from any subsequent handlers in the list so it's not a good general solution. I added a couple of ideas of a general solution but I didn't want to make the core methods async and I didn't really have time to investigate more (at least not right now).

I hope you'll get well soon and good job with updating and maintaining this great library 👍

@ThexXTURBOXx ThexXTURBOXx merged commit ed209a6 into ThexXTURBOXx:master Jan 29, 2024
2 checks passed
@ThexXTURBOXx
Copy link
Owner

Thank you very much for the exaplanation! :)
I have pushed this to pub.dev as version 1.2.0.
For the other improvements you mentioned, feel free to open another PR!

@mikeesouth mikeesouth deleted the sentry_file_upload branch February 8, 2024 16: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.

None yet

2 participants