Skip to content

chore: fix console.log regression after introducing ios-sim async api #3722

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
Jul 4, 2018

Conversation

Fatme
Copy link
Contributor

@Fatme Fatme commented Jul 3, 2018

PR Checklist

What is the current behavior?

tns run ios does not print the logs from iOS simulator

What is the new behavior?

tns run ios prints the logs from iOS simulator

if (device.isEmulator) {
return this.$iOSSimulatorLogProvider.startNewMutedLogProcess(device.deviceInfo.identifier);
}

return this.$iosDeviceOperations.startDeviceLog(device.deviceInfo.identifier);
return Promise.resolve(this.$iosDeviceOperations.startDeviceLog(device.deviceInfo.identifier));
Copy link
Contributor

Choose a reason for hiding this comment

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

you can make the method async and just return the this.$iosDeviceOperations.startDeviceLog(device.deviceInfo.identifier) call here.

@@ -17,6 +17,6 @@ export class AndroidLiveSyncService extends PlatformLiveSyncServiceBase implemen
return service;
}

public prepareForLiveSync(device: Mobile.IDevice, data: IProjectDir): void { /* */ }
public prepareForLiveSync(device: Mobile.IDevice, data: IProjectDir): Promise<void> { return Promise.resolve(); }
Copy link
Contributor

Choose a reason for hiding this comment

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

Marking the method as async would be enough, no need to return Promise.resolve()

@@ -66,9 +66,9 @@ export class IOSLiveSyncService extends PlatformLiveSyncServiceBase implements I
}
}

public prepareForLiveSync(device: Mobile.IDevice, data: IProjectDir, liveSyncInfo: ILiveSyncInfo): void {
public prepareForLiveSync(device: Mobile.IDevice, data: IProjectDir, liveSyncInfo: ILiveSyncInfo): Promise<void> {
Copy link
Contributor

Choose a reason for hiding this comment

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

this method must be marked as async as in case skipWatcher is true, it will not return promise

@Fatme Fatme force-pushed the fatme/fix-console-log branch from 69798e9 to 74f9d04 Compare July 4, 2018 05:41
@Fatme Fatme force-pushed the fatme/fix-console-log branch from 74f9d04 to e1a436b Compare July 4, 2018 05:51
@Fatme Fatme merged commit 25522d1 into master Jul 4, 2018
@Fatme Fatme deleted the fatme/fix-console-log branch July 4, 2018 08:32
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