Emit to room not working when client is Safari 15.5
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 63.2k
- Forks
- 10.3k
- Avg merge
- 11d 20h
- Merged PRs (30d)
- 2
Description
I have try with Chrome and Firefox is working fine that expected.
Describe the bug
I have a game with client is in react/typescript, server is in nodeJs/express/typescript
When I try to emit on specific room with
socket.to(message.roomId).emit("start_game", { start: false, symbol: "o" });
The client doesn't get the event. So the listener method isn't fired.
public async onStartGame(socket: Socket, listiner: (options: IStartGame) => void) {
socket.on("start_game", () => console.log(options));
// attempt to get { start: false, symbol: "o" } but is never fired
}
Notice that socket.emit is working fine.
socket.emit("start_game", { start: true, symbol: "x" });
To Reproduce
Try to communicate with a server and a client using Safari 15.5
Server
"socket.io": "^4.5.1",
Client
"socket.io-client": "^4.5.1"
Platform:
- on macOS Monterey version 12.4
- Macbook pro
Additional context
- I use
socket-controllerslibrairie that allow me to write decorator for event handling socket-controllers - The client side
- The server side
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked client and server repositories and reproduce the room broadcast in Safari 15.5 using the stated socket.io 4.5.1 packages; compare it with the working direct socket.emit path. Trace whether the failure is in room emission or the socket-controllers integration, and consider the issue done when the start_game listener receives the room event in Safari without breaking Chrome or Firefox.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- express, node.js, react, typescript
- Domain
- backend-api-design, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100