Skip to content

Add back connection type query param #14

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

Merged
merged 1 commit into from
Nov 10, 2021
Merged

Add back connection type query param #14

merged 1 commit into from
Nov 10, 2021

Conversation

code-asher
Copy link
Member

@code-asher code-asher requested a review from jsjoeio November 10, 2021 22:18
Copy link

@jsjoeio jsjoeio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're unstoppable!

socket = await createSocket(options.logService, options.socketFactory, options.host, options.port, `reconnectionToken=${options.reconnectionToken}&reconnection=${options.reconnectionProtocol ? 'true' : 'false'}`, timeoutCancellationToken);
// NOTE@coder: Add connection type to the socket. This is so they can be
// distinguished by the backend.
socket = await createSocket(options.logService, options.socketFactory, options.host, options.port, `type=${connectionTypeToString(connectionType)}&reconnectionToken=${options.reconnectionToken}&reconnection=${options.reconnectionProtocol ? 'true' : 'false'}`, timeoutCancellationToken);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ Why does the backend need to know the type connection? And what's an example connection type? ws, http, https?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type is either ExtensionHost or Management. The product uses websocket connections to determine if an editor is open. However since VS Code has two websockets it always counts as two opens.

Labeling the websockets with type lets the backend distinguish between the two sockets so it can count just one open.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh got it. That makes sense. Thanks for the explainer!

@code-asher code-asher merged commit a253181 into coder:code-server-v2 Nov 10, 2021
@code-asher code-asher deleted the connection-type branch November 10, 2021 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants