ueman / feedback

A simple widget for getting better feedback.
https://pub.dev/packages/feedback
392 stars 94 forks source link

sentry: Allow logging exception along #170

Closed sils closed 2 years ago

sils commented 2 years ago

:scroll: Description

Feature allowing to log the feedback to a sentry exception.

:bulb: Motivation and Context

Fixes https://github.com/ueman/feedback/issues/168

:green_heart: How did you test it?

Not at all yet, sorry :D

:pencil: Checklist

:crystal_ball: Next steps

Note that I have rather limited time, I hacked this together rather quickly but I can't guarantee I have enough time to pull it through.

ueman commented 2 years ago

Thanks! I've used this as a basis and done some improvements. I'll close therefore.

sils commented 2 years ago

@ueman note that your version of the code does not log the exception if the user chooses to dismiss the dialogue; in those cases it'd be rather useful to have just the exception without further data, right?

ueman commented 2 years ago

That's right, but the scope of the withScope callback is only guaranteed to be available inside the callback. So the attachment is only attached if it's done within it.

You're only able to attach attachments before reporting an exception or from within the scope callback. Otherwise it won't get attached to the specified exception.

I guess a way of knowing wether the user dismissed the feedback UI would be awesome new feature.

sils commented 2 years ago

I see. Yep in that case reporting the exception in case of dismissal seems to be a good idea.