- There is a topic on sending messages/notifications to logged in users here Communication between core application and backoffice ui
It accesses Vaadin sessions to detect logged in users, So I suppose that could be an entrypoint.
It is not clear to me how Vaadin session state is maintained (only heartbeat)?
- In the past, on another (non-cuba/non-jmix/non-vaadin) project I needed similar behavior for a dynamic scaling user cache. I solved it there by setting up websocket connections, because websocket connections events include disconnect (eg. by closing browser window). This is guaranteed behavior, it is part of the websocket specification.
This was the only guaranteed way of being notified of a browser being closed, there was no javascript solution other than heartbeats.
If Vaadin supports maintaining heartbeat through websocket solution 1 might be enough. (Or, if you can live with a delay equal to that heartbeat)