Safari doesn't logout from a chat on refresh
An environment:
- Safari 14.1.1 (16611.2.7.1.4) on macOS 11.4 (20F71);
- g8 template with root d72db85933f91a4d9f012ee2d8c643c36c4a40ac.
A step to reproduce:
- create a new project by
sbt new UdashFramework/udash.g8; - start it by
sbt compile compileStatics run; - open safari and go to a page;
- log in;
- refresh a page;
- log in one more time;
- see that number of connected users is
2.
The video:
https://user-images.githubusercontent.com/37775/127490487-5d3cc76f-5457-42f4-b489-33ae97cb3644.mov
The issue doesn't appear on Firefox, but it appears on Safari Technology Preview 127 (Safari 15.0, WebKit 16612.1.18.11.3).
This is probably related to poor support of WebSocket in Safari(especially close events). Not sure yet whether it's something we can work around(without much overhead), needs more investigation.
@mereszeta let me share a pcap with traffic from safari.
I've refreshed a page a few times, and before re-login to websocket on backed safari had closed a connection.
I feel that it is a bug in chat application or atmoshere or somewhere else on this stack. Why? Because when connection is closed a counter should be decreased.