You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug socket.id can be undefined according to the documentation (until connect event is triggered). But the Socket type does not mark it as possibly undefined.
To Reproduce
Check the documentation:
Check the code:
Describe the bug
socket.id
can be undefined according to the documentation (until connect event is triggered). But theSocket
type does not mark it as possibly undefined.To Reproduce
![image](https://private-user-images.githubusercontent.com/24510869/286673701-edbf7644-38ce-492f-8a1b-ad40341d9f82.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjYwOTUyMjUsIm5iZiI6MTcyNjA5NDkyNSwicGF0aCI6Ii8yNDUxMDg2OS8yODY2NzM3MDEtZWRiZjc2NDQtMzhjZS00OTJmLThhMWItYWQ0MDM0MWQ5ZjgyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTExVDIyNDg0NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTk5ZWQ5YjVjYzUwZGJiMTc1ZTQ0YmRkZmFlZDFkMWUzODExZjQ4NTEzNWFiOTJmY2I2YzQ4MDc3ZTg3Nzg1MDkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.G2OOd-wod5XLPbJLIOuFRDkWCmPVLOqItCeE-cck7X4)
Check the documentation:
Check the code:
socket.io/lib/socket.ts
Line 192 in 8c9ebc3
And:
https://github.com/socketio/socket.io-adapter/blob/28f60b880ad04ff4b48ade0cd529f1970643604f/lib/index.ts#L10
Socket.IO client version:
4.7.2
Expected behavior
Either the Socket or SocketId type should allow undefined values or the documentation should be clarified.
The text was updated successfully, but these errors were encountered: