-
-
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
Embedded error form not working when used with tunnel
in JavaScript SDK
#4679
Comments
As an alternative approach, I have gone the way of my own UI + API request to api/projects/submit-user-feedback, but now It's failing me in nothing being shown in the sentry UI… I am using the It seems like the ID I am given doesn't match the error event ID that was sent to the backend… even the {
"id": "19",
"eventID": "f279b22d40614f6e8fc62750c29c489e",
"name": "user_90000",
"email": "[email protected]",
"comments": "asdfggadgadfg",
"dateCreated": "2022-02-28T12:23:36.850598Z",
"user": null,
"event": {
"id": "f279b22d40614f6e8fc62750c29c489e",
"eventID": "f279b22d40614f6e8fc62750c29c489e"
},
"issue": null
} |
I have just forked your
EditGot those values to sync-up by commenting-out the |
Routing to @getsentry/open-source for triage. ⏲️ |
Can you unpack this for me @kubijo? My instinct is to route this over to the |
Let's try… I will also state some presumptions and opinions held on my side in connection to the The way I see it, the
Given these presumptions, my desire to have a React frontend connected to sentry and current state of affairs, I have to:
All that said, I'm aware that you cannot be sensibly expected to cover everyone's needs, but from my point of view there does seem to be a way to address all of these with few changes / additions that should break existing code.
As a sidenote to the point // New interface
type FeedbackPayload = {
event_id: string
user: string;
email: string;
comments: string;
};
type FeedbackStatus = {
status: 'ok' | 'error';
errors: Record<keyof FeedbackPayload, string>;
};
type SendFeedback = (FeedbackPayload) => Promise<FeedbackStatus>;
type SendFeedbackBound = (Omit<FeedbackPayload, 'event_id'>) => Promise<FeedbackStatus>;
// Slightly widened "ErrorBoundary.fallback"
type Fallback =
| ReactNode
| (
errorInfo: { error, componentStack, resetError },
feedback: SendFeedbackBound, // Since you already know the event_id in the component
) => ReactNode; However, I could take it or leave at this point, since the This design also presumes translated error messages in all supported languages on the customer web, but then again this presumption is there already & one way this could be addressed is returning some known set of IDs for the errors instead of error messages… or both and let users decide whether they want their own translations or use whatever comes … |
Okay yeah I'm gonna bump this to the JavaScript SDK team to digest that. 😂 Thanks for the great info! |
Routing to @getsentry/team-web-frontend for triage. ⏲️ |
This will be resolved once we send user feedback through envelopes instead of a dedicated endpoint. This will be unblocked by #4240 Moving to JS repo to mark as backlog + improvement. |
Is this then resolved since v7 is out? |
We use managed Sentry. We use the
|
Hi, has there been any update on this? I've implemented a custom tunnel for the error handling, but the feedback dialog still tries to connect to |
Hey, This works differently now and can be embedded into your page better, which should work well with tunnelling too! |
I am closing this issue because this can be solved with the new feedback UI. While this is not a 1-1 replacement, it is what we will continue to work on more in the future, so I think it makes sense to use this instead if needed! |
Environment
self-hosted (https://develop.sentry.dev/self-hosted/)
Version
22.2.0
Steps to Reproduce
tunnel
optionErrorBoundary
componentExpected Result
tunnel
endpoint (got this working through Django view, inspired by your Flask example)tunnel
endpoint to both load it's JS & submit data.Actual Result
1) The URL at which the SDK looks for the embedded form's JavaScript is not configurable
I was able to go around this by fiddling with DSN value in options for the dialog, but that's an ugly work-around since DSN is at this point about identification of org/project as opposed to anything with API location.
2) Cannot configure the
submit
URL of embedded formThis is probably very much connected to the first problem, but even when I work around the first one, this one gets into my way… that is to say that I am able to get the form to show up, but it has the following additional problems:
2.1. Submit URL is based on the internal absolute URL
This doesn't work in the context of my application, since that URL won't be publicly available.
Also, as a sidenote, I'm sure it doesn't also need to include all the GET parameters that got there from dialog options (I'm supplying all texts because I'd like to have them be part of our translation catalogs.
2.2. The embed JS is injected twice & the form itself shows twice as a result.
This might quite possibly stem from the fact that development mode of react re-throws errors it catches, but as far I was able to gather, the
ErrorBoundary
component uses APIs from vanilla JS package.There should be some kind of singleton sanity check around that JavaScript injection.
The text was updated successfully, but these errors were encountered: