Skip to content

fix: require user interaction for developer disk image only in debug #4259

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
Jan 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions lib/definitions/livesync.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,11 +330,9 @@ interface IEnableDebuggingDeviceOptions extends Mobile.IDeviceIdentifier, IOptio
/**
* Describes settings passed to livesync service in order to control event emitting during refresh application.
*/
interface IShouldSkipEmitLiveSyncNotification {
/**
* Whether to skip emitting an event during refresh. Default is false.
*/
interface IRefreshApplicationSettings {
shouldSkipEmitLiveSyncNotification: boolean;
shouldCheckDeveloperDiscImage: boolean;
}

/**
Expand Down
8 changes: 5 additions & 3 deletions lib/services/livesync/livesync-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
this.refreshApplicationWithoutDebug(projectData, liveSyncResultInfo, debugOpts, outputPath);
}

private async refreshApplicationWithoutDebug(projectData: IProjectData, liveSyncResultInfo: ILiveSyncResultInfo, debugOpts?: IDebugOptions, outputPath?: string, settings?: IShouldSkipEmitLiveSyncNotification): Promise<IRefreshApplicationInfo> {
private async refreshApplicationWithoutDebug(projectData: IProjectData, liveSyncResultInfo: ILiveSyncResultInfo, debugOpts?: IDebugOptions, outputPath?: string, settings?: IRefreshApplicationSettings): Promise<IRefreshApplicationInfo> {
let result: IRefreshApplicationInfo = { didRestart: false };
const platform = liveSyncResultInfo.deviceAppData.platform;
const platformLiveSyncService = this.getLiveSyncService(platform);
Expand All @@ -184,7 +184,9 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
});
}

this.handleDeveloperDiskImageError(err, liveSyncResultInfo, projectData, debugOpts, outputPath);
if (settings && settings.shouldCheckDeveloperDiscImage) {
this.handleDeveloperDiskImageError(err, liveSyncResultInfo, projectData, debugOpts, outputPath);
}
}

this.emitLivesyncEvent(LiveSyncEvents.liveSyncExecuted, {
Expand Down Expand Up @@ -214,7 +216,7 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
this.handleDeveloperDiskImageError(err, liveSyncResultInfo, projectData, debugOptions, outputPath);
}
} else {
const refreshInfo = await this.refreshApplicationWithoutDebug(projectData, liveSyncResultInfo, debugOptions, outputPath, { shouldSkipEmitLiveSyncNotification: true });
const refreshInfo = await this.refreshApplicationWithoutDebug(projectData, liveSyncResultInfo, debugOptions, outputPath, { shouldSkipEmitLiveSyncNotification: true, shouldCheckDeveloperDiscImage: true });
didRestart = refreshInfo.didRestart;
}

Expand Down