Skip to content

fix: socket not cleared on time for second sync #3783

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
Aug 1, 2018

Conversation

KristianDD
Copy link
Contributor

PR Checklist

What is the current behavior?

What is the new behavior?

Fixes/Implements/Closes #[Issue Number].

@KristianDD KristianDD force-pushed the kddimitrov/fix-two-fast-consecutive-syncs branch from 5c41250 to ccfa6d2 Compare August 1, 2018 07:25
@@ -381,12 +389,21 @@ export class AndroidLivesyncTool implements IAndroidLivesyncTool {
private handleSocketError(socketId: string, errorMessage: string) {
const error = this.getErrorWithMessage(errorMessage);
if (this.socketConnection && this.socketConnection.uid === socketId) {
this.end();
this.socketError = error;
this.end(error);
Copy link
Contributor

@Fatme Fatme Aug 1, 2018

Choose a reason for hiding this comment

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

Why do we need to pass error here as parameter? We can use it directly in end() function

public end() {
const error = this.socketError || this.getErrorWithMessage()
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is a personal preference. If someone moves this.socketError = error one line down or the error is not cleared at the right moment, the method might be broken without us noticing.

@KristianDD
Copy link
Contributor Author

run ci

1 similar comment
@KristianDD
Copy link
Contributor Author

run ci

@KristianDD KristianDD merged commit 3e70b85 into release Aug 1, 2018
@KristianDD KristianDD deleted the kddimitrov/fix-two-fast-consecutive-syncs branch August 1, 2018 12:04
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