Skip to content

Commit 3eb893a

Browse files
author
Dimitar Kerezov
committed
Post-rebase fixes
1 parent 7e1f1bd commit 3eb893a

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

lib/declarations.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ interface IiOSNotificationService {
310310
}
311311

312312
interface IiOSSocketRequestExecutor {
313-
executeLaunchRequest(device: Mobile.IiOSDevice, timeout: number, readyForAttachTimeout: number, projectId: string, shouldBreak?: boolean): Promise<void>;
313+
executeLaunchRequest(deviceIdentifier: string, timeout: number, readyForAttachTimeout: number, projectId: string, shouldBreak?: boolean): Promise<void>;
314314
executeAttachRequest(device: Mobile.IiOSDevice, timeout: number, projectId: string): Promise<void>;
315315
}
316316

lib/device-sockets/ios/socket-request-executor.ts

+13-13
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ export class IOSSocketRequestExecutor implements IiOSSocketRequestExecutor {
1010
const deviceIdentifier = device.deviceInfo.identifier;
1111

1212
const observeNotificationPromises = [
13-
await this.$iOSNotificationService.subscribeForNotification(deviceIdentifier, this.$iOSNotification.alreadyConnected, timeout),
14-
await this.$iOSNotificationService.subscribeForNotification(deviceIdentifier, this.$iOSNotification.readyForAttach, timeout),
15-
await this.$iOSNotificationService.subscribeForNotification(deviceIdentifier, this.$iOSNotification.attachAvailable, timeout)
13+
await this.$iOSNotificationService.subscribeForNotification(deviceIdentifier, this.$iOSNotification.getAlreadyConnected(projectId), timeout),
14+
await this.$iOSNotificationService.subscribeForNotification(deviceIdentifier, this.$iOSNotification.getReadyForAttach(projectId), timeout),
15+
await this.$iOSNotificationService.subscribeForNotification(deviceIdentifier, this.$iOSNotification.getAttachAvailable(projectId), timeout)
1616
];
1717

1818
// Trigger the notifications update.
19-
await this.$iOSNotificationService.postNotification(deviceIdentifier, this.$iOSNotification.attachAvailabilityQuery, constants.IOS_POST_NOTIFICATION_COMMAND_TYPE);
19+
await this.$iOSNotificationService.postNotification(deviceIdentifier, this.$iOSNotification.getAttachAvailabilityQuery(projectId), constants.IOS_POST_NOTIFICATION_COMMAND_TYPE);
2020

2121
let receivedNotification: string;
2222
try {
@@ -30,7 +30,7 @@ export class IOSSocketRequestExecutor implements IiOSSocketRequestExecutor {
3030
this.$errors.failWithoutHelp("A client is already connected.");
3131
break;
3232
case this.$iOSNotification.getAttachAvailable(projectId):
33-
await this.executeAttachAvailable(deviceIdentifier, timeout);
33+
await this.executeAttachAvailable(deviceIdentifier, projectId, timeout);
3434
break;
3535
case this.$iOSNotification.getReadyForAttach(projectId):
3636
break;
@@ -41,18 +41,18 @@ export class IOSSocketRequestExecutor implements IiOSSocketRequestExecutor {
4141
}
4242
}
4343

44-
public async executeLaunchRequest(deviceIdentifier: string, timeout: number, readyForAttachTimeout: number, shouldBreak?: boolean): Promise<void> {
44+
public async executeLaunchRequest(deviceIdentifier: string, timeout: number, readyForAttachTimeout: number, projectId: string, shouldBreak?: boolean): Promise<void> {
4545
try {
46-
const appLaunchingPromise = await this.$iOSNotificationService.subscribeForNotification(deviceIdentifier, this.$iOSNotification.appLaunching, timeout);
46+
const appLaunchingPromise = await this.$iOSNotificationService.subscribeForNotification(deviceIdentifier, this.$iOSNotification.getAppLaunching(projectId), timeout);
4747
await appLaunchingPromise;
4848
if (shouldBreak) {
49-
await this.$iOSNotificationService.postNotification(deviceIdentifier, this.$iOSNotification.waitForDebug, constants.IOS_POST_NOTIFICATION_COMMAND_TYPE);
49+
await this.$iOSNotificationService.postNotification(deviceIdentifier, this.$iOSNotification.getWaitForDebug(projectId), constants.IOS_POST_NOTIFICATION_COMMAND_TYPE);
5050
}
5151

5252
// We need to send the ObserveNotification ReadyForAttach before we post the AttachRequest.
53-
const readyForAttachPromise = await this.$iOSNotificationService.subscribeForNotification(deviceIdentifier, this.$iOSNotification.readyForAttach, readyForAttachTimeout);
53+
const readyForAttachPromise = await this.$iOSNotificationService.subscribeForNotification(deviceIdentifier, this.$iOSNotification.getReadyForAttach(projectId), readyForAttachTimeout);
5454

55-
await this.$iOSNotificationService.postNotification(deviceIdentifier, this.$iOSNotification.attachRequest, constants.IOS_POST_NOTIFICATION_COMMAND_TYPE);
55+
await this.$iOSNotificationService.postNotification(deviceIdentifier, this.$iOSNotification.getAttachRequest(projectId), constants.IOS_POST_NOTIFICATION_COMMAND_TYPE);
5656
await readyForAttachPromise;
5757
} catch (e) {
5858
this.$logger.trace("Launch request error:");
@@ -61,12 +61,12 @@ export class IOSSocketRequestExecutor implements IiOSSocketRequestExecutor {
6161
}
6262
}
6363

64-
private async executeAttachAvailable(deviceIdentifier: string, timeout: number): Promise<void> {
64+
private async executeAttachAvailable(deviceIdentifier: string, projectId: string, timeout: number): Promise<void> {
6565
try {
6666
// We should create this promise here because we need to send the ObserveNotification on the device
6767
// before we send the PostNotification.
68-
const readyForAttachPromise = await this.$iOSNotificationService.subscribeForNotification(deviceIdentifier, this.$iOSNotification.readyForAttach, timeout);
69-
await this.$iOSNotificationService.postNotification(deviceIdentifier, this.$iOSNotification.attachRequest);
68+
const readyForAttachPromise = await this.$iOSNotificationService.subscribeForNotification(deviceIdentifier, this.$iOSNotification.getReadyForAttach(projectId), timeout);
69+
await this.$iOSNotificationService.postNotification(deviceIdentifier, this.$iOSNotification.getAttachRequest(projectId));
7070
await readyForAttachPromise;
7171
} catch (e) {
7272
this.$errors.failWithoutHelp(`The application ${projectId} timed out when performing the socket handshake.`);

lib/services/ios-debug-service.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ class IOSDebugService implements IDebugService {
158158

159159
private async debugBrkCore(device: Mobile.IiOSDevice, projectData: IProjectData, shouldBreak?: boolean): Promise<void> {
160160
let timeout = this.$utils.getMilliSecondsTimeout(TIMEOUT_SECONDS);
161-
await this.$iOSSocketRequestExecutor.executeLaunchRequest(device.deviceInfo.identifier, timeout, timeout, shouldBreak);
162-
await this.wireDebuggerClient(device);
161+
await this.$iOSSocketRequestExecutor.executeLaunchRequest(device.deviceInfo.identifier, timeout, timeout, projectData.projectId, shouldBreak);
162+
await this.wireDebuggerClient(projectData, device);
163163
}
164164

165165
private async deviceStart(projectData: IProjectData): Promise<void> {

0 commit comments

Comments
 (0)