cron-mon-io / cron-mon-app

The frontend application for CronMon
MIT License
0 stars 0 forks source link

App intermittently passing `undefined` as a monitor ID to `GET /api/v1/monitors/{monitor_id}` #19

Closed howamith closed 4 months ago

howamith commented 4 months ago

Managed to reproduce this by simply navigating to a monitor and then navigating to the home page and waiting. When we navigate to the monitor page we start resyncing the monitor once every minute, using the monitor ID in the URL via vue-router's route.params.id. There's actually more than one problem here. The one described by this issue stems from the fact that when we navigate away from the monitor, route.params.id is undefined (unless we navigate to another page with an id param, of course). The other, is that once we've visited a monitor page, there's nothing to stop us from resyncing the monitor once a minute other than a refresh (or anything else which kills the JavaScript dealing with the timeouts and AJAX requests.