Pages still shown in pageIds key after being closed

For context, I am trying to play a sound in Perspective when an alarm comes in. The Audio component I am using is part of the navigation banner view which is present on every page. I have noticed that when I have multiple pages open in a session, I will hear the alarm play twice, as there are two instances of the component loaded.

To fix this, I added a script transform that calls system.perspective.getSessionInfo() and only allows the sound to play if the audio component is in the first page in the session. While this did solve the initial problem, I’ve noticed that if you close whatever page is considered “first”, the sound doesn’t play, and if you call system.perspective.getSessionInfo() again, that page still appears in the pageIds list for that session.

With that in mind, I have a couple of questions:

  • Is there a way to identify which pages are actually open in the browser and which are not despite showing up in the session info?
  • Is there an easier way to ensure exactly one instance of a sound plays per session?

Thanks in advance

Hi sho,

I would recommend opening a ticket with the Support Department if you are still having this issue. They will be better suited to help.

Just a note here: closing a page in your browser (or through a script) essentially closes the websocket for that page. On the backend, this registers as a connection loss, and we give the page 60 seconds (by default) to reconnect. During that 60 seconds, the page will still show as part of the session. After the 60 seconds have elapsed, we remove the page from the listings.