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

Add back window.onerror handler #45531

Closed
joshdover opened this issue Sep 12, 2019 · 4 comments
Closed

Add back window.onerror handler #45531

joshdover opened this issue Sep 12, 2019 · 4 comments
Labels
Feature:New Platform stale Used to mark issues that were closed for being stale Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc

Comments

@joshdover
Copy link
Contributor

In #41663, the global window.onerror error handler was not being imported / registered, so we've been allowing some silent errors for a few weeks now.

Unfortunately, adding it back is causing Kibana to crash due to #22913. Once that issue is resolved, we should add this error handler back, directly in the New Platform's FatalErrorService.

@joshdover joshdover added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Feature:New Platform labels Sep 12, 2019
@joshdover joshdover self-assigned this Sep 12, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform

@joshdover joshdover removed their assignment Sep 19, 2019
@joshdover joshdover self-assigned this Oct 22, 2019
@joshdover
Copy link
Contributor Author

Timebox 1 hour investigation, triage next week

@joshdover
Copy link
Contributor Author

We have two things now triggering window.onerror:

Both of these are fixable, but probably need to happen in EUI.

I looked more into the behavior of window.onerror and I'm now of the opinion we should not have a global handler that crashes the frontend, because:

  • Any uncaught JavaScript error can cause this error to fire, including errors triggered by 3rd party browser extensions.
  • Not all uncaught errors invalidate the state of Kibana, such as the ResizeObserver one above. Crashing the entire frontend seems heavy handed and even showing a error toast about something the user can't take action on is just unhelpful noise.

Options going forward:

  1. Fix these issues above and add back the window.onerror handler.
    • This could result in crashing Kibana unnecessarily
  2. Add a window.onerror handler that only shows a toast rather than crashing the entire frontend
    • Will result in some ugly UX until the above issues are fixed (though more can arise) however it's much less heavy-handed than the previous behavior
  3. Once the frontend logging service is built & can forward logs to the server, we could add a window.onerror handler that simply captures this information for debugging purposes.
  4. Don't add a window.onerror handler at all
    • Would probably be ok and shouldn't make support harder since these errors still appear in the Web Console.

@joshdover
Copy link
Contributor Author

  1. Use telemetry or some sort of error collection to report back to us.

@joshdover joshdover removed the blocker label Nov 19, 2019
@joshdover joshdover removed their assignment Nov 25, 2019
@joshdover joshdover added the stale Used to mark issues that were closed for being stale label Jan 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:New Platform stale Used to mark issues that were closed for being stale Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
None yet
Development

No branches or pull requests

2 participants