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

Bubbling up close message from websocket to the extension. #89

Merged
merged 7 commits into from Aug 7, 2019

Conversation

vidorteg
Copy link
Contributor

@vidorteg vidorteg commented Aug 2, 2019

This PR bubbles up the close message from the websocket to the extension, so when the websocket is closed the extension will be closed too.

Copy link
Member

@jalissia jalissia left a comment

Choose a reason for hiding this comment

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

Splitting out the close into its own event seems to make sense.

src/panelSocket.ts Outdated Show resolved Hide resolved
src/devtoolsPanel.ts Outdated Show resolved Hide resolved
src/devtoolsPanel.ts Outdated Show resolved Hide resolved
@vidorteg vidorteg requested a review from jalissia August 6, 2019 20:59
Detects if the close event has been triggered and the dispose function handled.
@vidorteg vidorteg requested a review from jalissia August 6, 2019 22:10
@vidorteg vidorteg requested a review from jalissia August 6, 2019 22:43
@@ -161,10 +161,14 @@ describe("devtoolsPanel", () => {
const dtp = await import("./devtoolsPanel");
dtp.DevToolsPanel.createOrShow(context, mockTelemetry, "", mockRuntimeConfig);

expect(mockPanelSocket.on).toHaveBeenCalledTimes(Object.keys(webviewEventNames).length);
expect(mockPanelSocket.on).toHaveBeenCalledTimes(Object.keys(webviewEventNames).length + 1);
Copy link
Member

Choose a reason for hiding this comment

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

Add a small comment to explain the +1 E.g. // +1 for 'close' event

Copy link
Member

@jalissia jalissia left a comment

Choose a reason for hiding this comment

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

LGTM with a minor comment

@vidorteg vidorteg merged commit 1022075 into master Aug 7, 2019
@vidorteg vidorteg deleted the vidal/closeDevtoolsOnExit branch August 7, 2019 19:51
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.

None yet

2 participants