Skip to content

chore: merge release into master #5009

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 5 commits into from
Sep 4, 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
2 changes: 1 addition & 1 deletion docs/man_pages/lib-management/plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ Command | Description
[plugin remove](plugin-remove.html) | Uninstalls the specified plugin and its dependencies.
[plugin update](plugin-update.html) | Updates the specified plugin(s) and its dependencies.
[plugin build](plugin-build.html) | Builds the Android project of a NativeScript plugin, and updates the `include.gradle`.
[plugin create](plugin-create.html) | Builds the Android project of a NativeScript plugin, and updates the `include.gradle`.
[plugin create](plugin-create.html) | Creates a new project for NativeScript plugin development.
<% } %>
1 change: 1 addition & 0 deletions lib/controllers/run-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ export class RunController extends EventEmitter implements IRunController {
const debugOptions = deviceDescriptor.debugOptions || {};

liveSyncResultInfo.waitForDebugger = !!debugOptions.debugBrk;
liveSyncResultInfo.forceRefreshWithSocket = true;

const refreshInfo = await this.refreshApplicationWithoutDebug(projectData, liveSyncResultInfo, filesChangeEventData, deviceDescriptor, { shouldSkipEmitLiveSyncNotification: true, shouldCheckDeveloperDiscImage: true });

Expand Down
3 changes: 2 additions & 1 deletion lib/definitions/livesync.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ declare global {
isFullSync: boolean;
waitForDebugger?: boolean;
deviceAppData: Mobile.IDeviceAppData;
didRecover?: boolean
didRecover?: boolean;
forceRefreshWithSocket?: boolean;
}

interface IAndroidLiveSyncResultInfo extends ILiveSyncResultInfo, IAndroidLivesyncSyncOperationResult { }
Expand Down
14 changes: 9 additions & 5 deletions lib/services/livesync/ios-device-livesync-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ export class IOSDeviceLiveSyncService extends DeviceLiveSyncServiceBase implemen
super(platformsDataService, device);
}

private canRefreshWithNotification(projectData: IProjectData): boolean {
private canRefreshWithNotification(projectData: IProjectData, liveSyncInfo?: ILiveSyncResultInfo): boolean {
if (liveSyncInfo && liveSyncInfo.forceRefreshWithSocket) {
return false;
}

if (this.device.isEmulator) {
return false;
}
Expand Down Expand Up @@ -72,7 +76,7 @@ export class IOSDeviceLiveSyncService extends DeviceLiveSyncServiceBase implemen
shouldRestart = true;
} else {
const canExecuteFastSync = this.canExecuteFastSyncForPaths(liveSyncInfo, localToDevicePaths, projectData, deviceAppData.platform);
const isRefreshConnectionSetup = this.canRefreshWithNotification(projectData) || (!this.device.isOnlyWiFiConnected && await this.setupSocketIfNeeded(projectData));
const isRefreshConnectionSetup = this.canRefreshWithNotification(projectData, liveSyncInfo) || (!this.device.isOnlyWiFiConnected && await this.setupSocketIfNeeded(projectData));
if (!canExecuteFastSync || !isRefreshConnectionSetup) {
shouldRestart = true;
}
Expand All @@ -93,7 +97,7 @@ export class IOSDeviceLiveSyncService extends DeviceLiveSyncServiceBase implemen

try {
if (otherFiles.length) {
didRefresh = await this.refreshApplicationCore(projectData);
didRefresh = await this.refreshApplicationCore(projectData, liveSyncInfo);
}
} catch (e) {
didRefresh = false;
Expand All @@ -102,9 +106,9 @@ export class IOSDeviceLiveSyncService extends DeviceLiveSyncServiceBase implemen
return didRefresh;
}

private async refreshApplicationCore(projectData: IProjectData) {
private async refreshApplicationCore(projectData: IProjectData, liveSyncInfo: ILiveSyncResultInfo) {
let didRefresh = true;
if (this.canRefreshWithNotification(projectData)) {
if (this.canRefreshWithNotification(projectData, liveSyncInfo)) {
didRefresh = await this.refreshWithNotification(projectData);
} else {
if (await this.setupSocketIfNeeded(projectData)) {
Expand Down