socketio / socketio/socket.io

Emit to room not working when client is Safari 15.5

Open
#4,410 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs investigation
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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.