socket.io icon indicating copy to clipboard operation
socket.io copied to clipboard

fix: room empty timeout error

Open Wuchieh opened this issue 5 months ago • 4 comments

Resolve a timeout issue that may happen if rooms on other servers don’t have any connections.

Wuchieh avatar Sep 25 '25 07:09 Wuchieh

Can you provide a test case to reproduce your issue?

zishang520 avatar Sep 26 '25 00:09 zishang520

Can you provide a test case to reproduce your issue?您能否提供測試案例來重現您的問題?

Alright, I'll provide the test cases to you later.

Let me briefly describe the issue first. After using the Redis adapter, when calling socket.To().FetchSockets, if the room doesn't exist on the other server or there are no sockets connected to it, the sockets return value will be empty. In this case, the receiver chooses to ignore it directly, potentially failing to trigger the callback correctly and causing a timeout.

Translated with DeepL.com (free version)

Wuchieh avatar Sep 26 '25 02:09 Wuchieh

Can you provide a test case to reproduce your issue?

https://youtu.be/sE778ntCWY8?si=2ibtbGJj5qETO6qM

https://github.com/Wuchieh/socketio-issus-250926

Wuchieh avatar Sep 26 '25 13:09 Wuchieh

OK,I will look into it.

zishang520 avatar Sep 26 '25 13:09 zishang520