Skip to content

Commit 4d0724b

Browse files
committed
fix: fix PR comments
1 parent fdfa5a6 commit 4d0724b

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

lib/declarations.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ interface IiOSNotification extends NodeJS.EventEmitter {
761761

762762
interface IiOSSocketRequestExecutor {
763763
executeAttachRequest(device: Mobile.IiOSDevice, timeout: number, projectId: string): Promise<void>;
764-
executeRefreshRequest(device: Mobile.IiOSDevice, appId: string): Promise<boolean>;
764+
executeRefreshRequest(device: Mobile.IiOSDevice, timeout: number, appId: string): Promise<boolean>;
765765
}
766766

767767
/**

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

+5-6
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,23 @@ export class IOSSocketRequestExecutor implements IiOSSocketRequestExecutor {
1212
await this.executeRequest(mainRequestName, readyRequestName, appId, deviceId, timeout);
1313
}
1414

15-
public async executeRefreshRequest(device: Mobile.IiOSDevice, appId: string): Promise<boolean> {
15+
public async executeRefreshRequest(device: Mobile.IiOSDevice, timeout: number, appId: string): Promise<boolean> {
1616
const deviceId = device.deviceInfo.identifier;
1717
const mainRequestName = this.$iOSNotification.getRefreshRequest(appId);
18-
const readyRequestName = this.$iOSNotification.getAppRefreshStarted(appId);
19-
const timeout = 5;
18+
const refreshRequestStartedName = this.$iOSNotification.getAppRefreshStarted(appId);
2019

21-
const result = await this.executeRequest(mainRequestName, readyRequestName, appId, deviceId, timeout);
20+
const result = await this.executeRequest(mainRequestName, refreshRequestStartedName, appId, deviceId, timeout);
2221

2322
return result;
2423
}
2524

26-
private async executeRequest(mainRequestName: string, readyRequestName: string, appId: string, deviceId: string, timeout: number): Promise<boolean> {
25+
private async executeRequest(mainRequestName: string, successfulyExecutedNotificationName: string, appId: string, deviceId: string, timeout: number): Promise<boolean> {
2726
let isSuccessful = false;
2827

2928
try {
3029
// We should create this promise here because we need to send the ObserveNotification on the device
3130
// before we send the PostNotification.
32-
const socket = await this.$iOSNotificationService.postNotification(deviceId, readyRequestName, constants.IOS_OBSERVE_NOTIFICATION_COMMAND_TYPE);
31+
const socket = await this.$iOSNotificationService.postNotification(deviceId, successfulyExecutedNotificationName, constants.IOS_OBSERVE_NOTIFICATION_COMMAND_TYPE);
3332
const notificationPromise = this.$iOSNotificationService.awaitNotification(deviceId, +socket, timeout);
3433
await this.$iOSNotificationService.postNotification(deviceId, mainRequestName);
3534
await notificationPromise;

lib/services/livesync/ios-device-livesync-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export class IOSDeviceLiveSyncService extends DeviceLiveSyncServiceBase implemen
116116
private async refreshWithNotification(projectData: IProjectData) {
117117
let didRefresh = false;
118118
await this.$lockService.executeActionWithLock(async () => {
119-
didRefresh = await this.$iOSSocketRequestExecutor.executeRefreshRequest(this.device, projectData.projectIdentifiers.ios);
119+
didRefresh = await this.$iOSSocketRequestExecutor.executeRefreshRequest(this.device, 5, projectData.projectIdentifiers.ios);
120120
}, `ios-device-livesync-${this.device.deviceInfo.identifier}-${projectData.projectIdentifiers.ios}.lock`);
121121

122122
return didRefresh;

0 commit comments

Comments
 (0)