Skip to content
This repository was archived by the owner on Dec 23, 2021. It is now read-only.

Properly disconnect socket io on exit #221

Merged
merged 24 commits into from
Feb 27, 2020

Conversation

xnkevinnguyen
Copy link
Contributor

Description:

Sometimes on restart, socket io does not get disconnected properly on the python side. Restarting it causes a problem since it will try to reconnect on the same port.

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Limitations:

Please describe limitations of this PR

Testing:

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Checklist:

  • My code follows the style guidelines of this project
  • My code has been formatted with npm run format and passes the checks in npm run check
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

@xnkevinnguyen xnkevinnguyen changed the title Properly disconnect socket io on exit WIP: Properly disconnect socket io on exit Feb 25, 2020
@isadorasophia
Copy link
Contributor

I think there are some changes from #217 here? If we are depending on that check-in first, it might be easier to complete that one and then rebase users/t-anmah/debugger-socket-fix with dev.

@xnkevinnguyen xnkevinnguyen changed the title WIP: Properly disconnect socket io on exit Properly disconnect socket io on exit Feb 26, 2020
Copy link

@nasadigital nasadigital left a comment

Choose a reason for hiding this comment

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

It's first time that I use the device simulator express debugger, it's awesome!

Copy link
Contributor

@isadorasophia isadorasophia left a comment

Choose a reason for hiding this comment

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

Pretty cool! 😁

Copy link

@nasadigital nasadigital left a comment

Choose a reason for hiding this comment

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

LGTM.
I think the debugger is much more reliable than most other VS Code extensions. Awesome work!

@@ -34,6 +34,7 @@ export class DebugAdapter implements DebugAdapterTracker {
if (!message.arguments.restart) {
this.debugCommunicationService.handleStopEvent();
}
break;

Choose a reason for hiding this comment

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

You could also add a default case which would throw an UnsupportedOperationException. Up to you.

Comment on lines 23 to 25
if (this.previousDebuggerServerToDisconnect) {
this.previousDebuggerServerToDisconnect.disconnectFromPort();
}

Choose a reason for hiding this comment

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

You can replace lines 23~25 with:
this.previousDebuggerServerToDisconnect?.disconnectFromPort()
Same for other places.

@xnkevinnguyen xnkevinnguyen merged commit 11ac3d8 into dev Feb 27, 2020
@xnkevinnguyen xnkevinnguyen deleted the users/t-anmah/debugger-socket-fix branch February 28, 2020 21:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants