Skip to content
This repository was archived by the owner on Feb 2, 2021. It is now read-only.

Return the real transferred files when transferDirectory of device fs is called #992

Merged
merged 1 commit into from
Jul 26, 2017

Conversation

rosen-vladimirov
Copy link
Collaborator

@rosen-vladimirov rosen-vladimirov commented Jul 25, 2017

When uploading files on devices/emulators, we are executing either transferDirectory or transferFiles methods of the specific device instance.
However for Android devices, the transferDirectory method has some logic to transfer only modified files (based on shasums from previous execution). So it doesn't really transfer the directory, but just several files.
For LiveSync purposes it is important to know which are the tranferred files, so change the return type of transferDirectory method to return the exact files that we've sent to device.

Try-catch the stop of iOS Application as it may fail in some rare cases - in this case just retry it.

@justcodebuilduser
Copy link

💔

@@ -102,28 +102,27 @@ export class AndroidDeviceFileSystem implements Mobile.IDeviceFileSystem {

let deviceHashService = this.getDeviceHashService(deviceAppData.appIdentifier);
let filesToChmodOnDevice: string[] = devicePaths;
if (this.$options.force) {
let tranferredFiles: Mobile.ILocalToDevicePathData[] = [];
let oldShasums = await deviceHashService.getShasumsFromDevice();
Copy link
Contributor

Choose a reason for hiding this comment

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

const?

} else {
await this.adb.executeCommand(["push", projectFilesPath, await deviceAppData.getDeviceProjectRootPath()]);
}
let changedShasums: any = _.omitBy(currentShasums, (hash: string, pathToFile: string) => !!_.find(oldShasums, (oldHash: string, oldPath: string) => pathToFile === oldPath && hash === oldHash));
Copy link
Contributor

Choose a reason for hiding this comment

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

const?

@rosen-vladimirov rosen-vladimirov force-pushed the vladimirov/fix-livesync-after-uninstall branch from 09330ac to fa6e6f2 Compare July 26, 2017 13:14
@justcodebuilduser
Copy link

💔

Copy link
Contributor

@Mitko-Kerezov Mitko-Kerezov left a comment

Choose a reason for hiding this comment

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

Looks okay to me

… is called

When uploading files on devices/emulators, we are executing either `transferDirectory` or `transferFiles` methods of the specific device instance.
However for Android devices, the transferDirectory method has some logic to transfer only modified files (based on shasums from previous execution). So it doesn't really transfer the directory, but just several files.
For LiveSync purposes it is important to know which are the tranferred files, so change the return type of `transferDirectory` method to return the exact files that we've sent to device.

Try-catch the stop of iOS Application as it may fail in some rare cases - in this case just retry it.
@rosen-vladimirov rosen-vladimirov force-pushed the vladimirov/fix-livesync-after-uninstall branch from fa6e6f2 to e0f0174 Compare July 26, 2017 13:34
@justcodebuilduser
Copy link

💔

@rosen-vladimirov rosen-vladimirov merged commit 359f750 into master Jul 26, 2017
@rosen-vladimirov rosen-vladimirov deleted the vladimirov/fix-livesync-after-uninstall branch July 26, 2017 13:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants