-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add onClose callback (or equiv) to showReportDialog #9433
Add onClose callback (or equiv) to showReportDialog #9433
Comments
Hey @phayes. I can see you left a comment on #758 - you're right that an PRs are welcome if you're interested in contributing! The report dialog HTML is on the main Sentry site, and the logic to control the report dialog can be seen here: sentry-javascript/packages/browser/src/sdk.ts Line 134 in d8beaa0
|
Hello, original reporter of the issue here. I took a stab at this over the weekend, please let me know if there's anything else missing. I created three PRs for this:
Finally, here's a demo project: https://github.com/arya-s/sentry-onclose-report-dialog |
Hi, @arya-s thanks for taking a stab at this. I hope we will get around to reviewing this in a timely manner. |
Sends `reportdialog_closed` via window.postMessage to the parent of the error page embed in preparation of supporting an `onClose` callback in @sentry/browser `showReportDialog`. Fixes getsentry/sentry-javascript#9433
Adds an `onClose` callback to `showReportDialog`. The callback is invoked when a `__sentry_reportdialog_closed__` MessageEvent is received. This is sent from the error page embed via `window.postMessage` and listened to in the sdk.
Released and documented with https://github.com/getsentry/sentry-javascript/releases/tag/7.82.0. Thanks a lot @arya-s for your contribution. |
@AbhiPrasad thanks for the guidance and code review :) |
Thank you @arya-s!!! Great work 🚀 |
Problem Statement
I want to be able to take an action after a user has closed the report-dialog (opened via
showReportDialog
).Specifically, after my javascript application has crashed (gotten into a unknown and likely corrupted state) I pop the report dialog via the
showReportDialog
. After the user either submits their report or otherwise closes the dialog I want to reload the page.This is re-opening #758
The solution suggested in the previous issue does not work for three reasons:
Solution Brainstorm
An an 'onClose' callback.
The text was updated successfully, but these errors were encountered: