From 792d7a53b9b488c8c519b94a892ebdadd4fb67e2 Mon Sep 17 00:00:00 2001 From: Tsvetan Raikov Date: Mon, 27 Jun 2016 10:35:51 +0300 Subject: [PATCH 1/2] Fixed first time livesync --- lib/services/livesync/android-livesync-service.ts | 7 +++++-- lib/services/livesync/ios-livesync-service.ts | 6 ++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/services/livesync/android-livesync-service.ts b/lib/services/livesync/android-livesync-service.ts index 4edaafe186..86d30a8117 100644 --- a/lib/services/livesync/android-livesync-service.ts +++ b/lib/services/livesync/android-livesync-service.ts @@ -71,8 +71,11 @@ class AndroidLiveSyncService extends liveSyncServiceBaseLib.LiveSyncServiceBase< }).future()(); } - public afterInstallApplicationAction(deviceAppData: Mobile.IDeviceAppData, localToDevicePaths: Mobile.ILocalToDevicePathData[]): IFuture { - return this.deviceHashService.uploadHashFileToDevice(localToDevicePaths); + public afterInstallApplicationAction(deviceAppData: Mobile.IDeviceAppData, localToDevicePaths: Mobile.ILocalToDevicePathData[]): IFuture { + return (() => { + this.deviceHashService.uploadHashFileToDevice(localToDevicePaths).wait(); + return false; + }).future()(); } private getDeviceRootPath(appIdentifier: string): string { diff --git a/lib/services/livesync/ios-livesync-service.ts b/lib/services/livesync/ios-livesync-service.ts index 55a4583378..1c993991e1 100644 --- a/lib/services/livesync/ios-livesync-service.ts +++ b/lib/services/livesync/ios-livesync-service.ts @@ -19,6 +19,12 @@ class IOSLiveSyncService extends liveSyncServiceBaseLib.LiveSyncServiceBase { + return (() => { + return this.$options.watch; + }).future()(); + } + public removeFiles(appIdentifier: string, localToDevicePaths: Mobile.ILocalToDevicePathData[]): IFuture { return (() => { _.each(localToDevicePaths, localToDevicePathData => this.device.fileSystem.deleteFile(localToDevicePathData.getDevicePath(), appIdentifier)); From 89ff50562eae141cdd48c083811e0b2632d43ed1 Mon Sep 17 00:00:00 2001 From: Tsvetan Raikov Date: Mon, 27 Jun 2016 16:10:55 +0300 Subject: [PATCH 2/2] fixed livesync --- lib/common | 2 +- lib/services/livesync/android-livesync-service.ts | 7 +++++-- lib/services/livesync/ios-livesync-service.ts | 6 ++++++ lib/services/livesync/livesync-service-base.ts | 9 +++++++-- 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/lib/common b/lib/common index 808eed1bbd..db6f35b948 160000 --- a/lib/common +++ b/lib/common @@ -1 +1 @@ -Subproject commit 808eed1bbd12cecfa9403833bc4ec517a3660378 +Subproject commit db6f35b9487c6ff7a2a21fbfbc7a44a0583e9eb2 diff --git a/lib/services/livesync/android-livesync-service.ts b/lib/services/livesync/android-livesync-service.ts index 4edaafe186..7e0adff6db 100644 --- a/lib/services/livesync/android-livesync-service.ts +++ b/lib/services/livesync/android-livesync-service.ts @@ -71,8 +71,11 @@ class AndroidLiveSyncService extends liveSyncServiceBaseLib.LiveSyncServiceBase< }).future()(); } - public afterInstallApplicationAction(deviceAppData: Mobile.IDeviceAppData, localToDevicePaths: Mobile.ILocalToDevicePathData[]): IFuture { - return this.deviceHashService.uploadHashFileToDevice(localToDevicePaths); + public afterInstallApplicationAction(deviceAppData: Mobile.IDeviceAppData, localToDevicePaths: Mobile.ILocalToDevicePathData[]): IFuture { + return (() => { + this.deviceHashService.uploadHashFileToDevice(localToDevicePaths).wait(); + return false; + }).future()(); } private getDeviceRootPath(appIdentifier: string): string { diff --git a/lib/services/livesync/ios-livesync-service.ts b/lib/services/livesync/ios-livesync-service.ts index 55a4583378..5c7f9f4863 100644 --- a/lib/services/livesync/ios-livesync-service.ts +++ b/lib/services/livesync/ios-livesync-service.ts @@ -19,6 +19,12 @@ class IOSLiveSyncService extends liveSyncServiceBaseLib.LiveSyncServiceBase { + return (() => { + return this.$options.watch; + }).future()(); + } + public removeFiles(appIdentifier: string, localToDevicePaths: Mobile.ILocalToDevicePathData[]): IFuture { return (() => { _.each(localToDevicePaths, localToDevicePathData => this.device.fileSystem.deleteFile(localToDevicePathData.getDevicePath(), appIdentifier)); diff --git a/lib/services/livesync/livesync-service-base.ts b/lib/services/livesync/livesync-service-base.ts index 1d8e1bd403..bbeeb1db82 100644 --- a/lib/services/livesync/livesync-service-base.ts +++ b/lib/services/livesync/livesync-service-base.ts @@ -7,8 +7,13 @@ export abstract class LiveSyncServiceBase { private $liveSyncProvider: ILiveSyncProvider) { } public refreshApplication(deviceAppData: Mobile.IDeviceAppData, localToDevicePaths: Mobile.ILocalToDevicePathData[], forceExecuteFullSync: boolean): IFuture { - let canExecuteFastSync = !forceExecuteFullSync && localToDevicePaths && - _.each(localToDevicePaths, localToDevicePath => this.$liveSyncProvider.canExecuteFastSync(localToDevicePath.getLocalPath(), deviceAppData.platform)); + let canExecuteFastSync = !forceExecuteFullSync && localToDevicePaths !== undefined; + for (let localToDevicePath of localToDevicePaths) { + if (!this.$liveSyncProvider.canExecuteFastSync(localToDevicePath.getLocalPath(), deviceAppData.platform)) { + canExecuteFastSync = false; + break; + } + } if (canExecuteFastSync) { return this.reloadPage(deviceAppData); }