Skip to content

Conversation

@rosen-vladimirov
Copy link
Contributor

@rosen-vladimirov rosen-vladimirov commented Mar 28, 2019

Whenever all devices/emulators/simulators that we are using for LiveSync operation are disconnected or we are unable to sync changes on them, the command (tns debug, tns run...) should exit.
This is not happening currently due to the setIntervals and iOS device detection that happens and does not stop when the devices are disconnected. So workaround the problem by handling the liveSyncStopped event for the livesync related commands. In case we receive liveSyncStopped for all devices that we've been using for LiveSync action, call process.exit. Use non-zero exit code for this case, as if we receive liveSyncStopped event, we've either received error for particular device or it has been stopped. For both cases this is not a correct behavior for LiveSync.

PR Checklist

What is the current behavior?

When you execute tns run <platform> and disconnect all devices at some point, CLI command continue its execution.

What is the new behavior?

When you execute tns run <platform> and disconnect all devices at some point, CLI command stops its execution.

Fixes issue #4495

Whenever all devices/emulators/simulators that we are using for LiveSync operation are disconnected or we are unable to sync changes on them, the command (`tns debug`, `tns run`...) should exit.
This is not happening currently due to the setIntervals and iOS device detection that happens and does not stop when the devices are disconnected. So workaround the problem by handling the liveSyncStopped event for the livesync related commands. In case we receive liveSyncStopped for all devices that we've been using for LiveSync action, call process.exit. Use non-zero exit code for this case, as if we receive liveSyncStopped event, we've either received error for particular device or it has been stopped. For both cases this is not a correct behavior for LiveSync.
@rosen-vladimirov rosen-vladimirov added this to the 5.3.1 milestone Mar 28, 2019
@rosen-vladimirov rosen-vladimirov self-assigned this Mar 28, 2019
@cla-bot cla-bot bot added the cla: yes label Mar 28, 2019
@ghost ghost added the new PR label Mar 28, 2019
@rosen-vladimirov rosen-vladimirov merged commit 792e8ed into release-patch Mar 28, 2019
@rosen-vladimirov rosen-vladimirov deleted the vladimirov/livesync-improvements branch March 28, 2019 11:57
@ghost ghost removed the new PR label Mar 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants