keymanapp / keymanweb.com

https://keymanweb.com/ source
2 stars 2 forks source link

bug: button refreshing callback can trigger JS error on page refresh #111

Closed jahorton closed 5 months ago

jahorton commented 5 months ago

This corresponds to a Sentry error report in which the #message element, statically defined within the main page's HTML, is undefined when reference. The method directly triggering the error is only called after the page is fully loaded, with the caller being a window.setInterval call at the end of the $(document).ready() callback method.

(The setInterval call) https://github.com/keymanapp/keymanweb.com/blob/81d1f6284f30797fef76b67efba549a22889d15f/cdn/dev/js/kmwlive.js#L245

jahorton commented 5 months ago

I can see two potential approaches here:

  1. Add a null-guard to the offending line
  2. Prevent the function from being called in the first place, possibly by cancelling the setInterval during page-unload.
sentry-io[bot] commented 5 months ago

Sentry Issue: [KEYMANWEB-COM-FM](https://keyman.sentry.io/issues/3410327727/?referrer=github_integration

(the correct one, this time)