Avoid chunk errors by refreshing

If a user opens GlitchTip in a browser, and then it updates, they will get a chunk loading error. The needed chunk no longer exists. I like the approach discussed here where it refreshes the browser instead. I also like the suggestion to push a ?refresh=true query param to indicate a refresh and prevent a refresh loop.

Requirements

  • Catch and avoid submitting chunk errors to GlitchTip (meaning a GlitchTip instance monitoring GlitchTip)
  • Instead of erroring out, refresh. Do not inform the user - just do it.
  • If the refresh happened once, don't do it again. Avoid refresh loops.