sfbrigade / bats-server

Routed is an app to help ambulances direct non-critical patients to hospital emergency rooms with the most availability.
https://routedapp.org/
GNU Affero General Public License v3.0
18 stars 12 forks source link

Ringdown notification sound on ER interface is looping- should play once only #230

Closed francisli closed 11 months ago

francisli commented 1 year ago

Heroku timeout rules apply to websocket inactivity, which may be the reason why the ringdown notification is looping.

reference: https://devcenter.heroku.com/articles/websockets#timeouts

KotovSyndrome commented 1 year ago

Able to reproduce the error very intermittently. My current plan is to do some investigation into the useEffect() hook and see why it's being called multiple times in a row, because I think that has something to do with why the sound plays multiple times in quick succession for some ringdowns.

francisli commented 1 year ago

We've determined that the ringdown sound plays when the websocket connection is interrupted and re-connects, which triggers a full refresh and resets the app state.

Per the documentation on Heroku, idle websockets will be closed per standard Heroku policy:

https://devcenter.heroku.com/articles/websockets#timeouts

However, sending a regular ping would keep the connection alive.

fwextensions commented 1 year ago

Separate from sending a keepalive, seems like the app shouldn't reset just because the websocket closes?