Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TS] socket.id is private and there is no public getter #644

Closed
SonahtQ opened this issue May 21, 2022 · 1 comment
Closed

[TS] socket.id is private and there is no public getter #644

SonahtQ opened this issue May 21, 2022 · 1 comment
Labels
question Further information is requested

Comments

@SonahtQ
Copy link

SonahtQ commented May 21, 2022

Describe the bug
Recently engine.io got whole new typescript code, but there are places that need for fixes.
One of it is private field id in Socket class. Getting and id of Socket is one of core mechanism that people use in theirs projects. Now there is no way for getting an id of Socket due to it's private accessor.

Engine.IO server version: 6.2.0

Solution
id field in Socket class is set to be readonly so it should be 100% safe to switch it from being private to being public.
Other way for fixing it can be for example adding public getter method to Socket class.

@SonahtQ SonahtQ added the bug Something isn't working label May 21, 2022
darrachequesne added a commit that referenced this issue Dec 5, 2022
@darrachequesne
Copy link
Member

I don't think this is a good idea, as it might lead users to think that the id can be safely shared with others. What do you think?

I added a note in 3d28229.

Please reopen if needed.

@darrachequesne darrachequesne added question Further information is requested and removed bug Something isn't working labels Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants