Skip to content

Commit 9726009

Browse files
committed
fix: update hashes on transfer file and remove file
1 parent a797a29 commit 9726009

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

lib/services/livesync/android-device-livesync-sockets-service.ts

+10-2
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ export class AndroidDeviceSocketsLiveSyncService extends DeviceLiveSyncServiceBa
9090

9191
public async removeFiles(deviceAppData: Mobile.IDeviceAppData, localToDevicePaths: Mobile.ILocalToDevicePathData[], projectFilesPath: string): Promise<void> {
9292
await this.livesyncTool.removeFiles(_.map(localToDevicePaths, (element: any) => element.filePath));
93+
94+
await this.getDeviceHashService(deviceAppData.appIdentifier).removeHashes(localToDevicePaths);
9395
}
9496

9597
public async transferFiles(deviceAppData: Mobile.IDeviceAppData, localToDevicePaths: Mobile.ILocalToDevicePathData[], projectFilesPath: string, isFullSync: boolean): Promise<Mobile.ILocalToDevicePathData[]> {
@@ -98,15 +100,21 @@ export class AndroidDeviceSocketsLiveSyncService extends DeviceLiveSyncServiceBa
98100
if (isFullSync) {
99101
transferredFiles = await this._transferDirectory(deviceAppData, localToDevicePaths, projectFilesPath);
100102
} else {
101-
transferredFiles = await this._transferFiles(localToDevicePaths);
103+
transferredFiles = await this._transferFiles(deviceAppData, localToDevicePaths);
102104
}
103105

104106
return transferredFiles;
105107
}
106108

107-
private async _transferFiles(localToDevicePaths: Mobile.ILocalToDevicePathData[]): Promise<Mobile.ILocalToDevicePathData[]> {
109+
private async _transferFiles(deviceAppData: Mobile.IDeviceAppData, localToDevicePaths: Mobile.ILocalToDevicePathData[]): Promise<Mobile.ILocalToDevicePathData[]> {
108110
await this.livesyncTool.sendFiles(localToDevicePaths.map(localToDevicePathData => localToDevicePathData.getLocalPath()));
109111

112+
// Update hashes
113+
const deviceHashService = this.getDeviceHashService(deviceAppData.appIdentifier);
114+
if (! await deviceHashService.updateHashes(localToDevicePaths)) {
115+
this.$logger.trace("Unable to find hash file on device. The next livesync command will create it.");
116+
}
117+
110118
return localToDevicePaths;
111119
}
112120

0 commit comments

Comments
 (0)