@@ -12,24 +12,23 @@ export class IOSSocketRequestExecutor implements IiOSSocketRequestExecutor {
12
12
await this . executeRequest ( mainRequestName , readyRequestName , appId , deviceId , timeout ) ;
13
13
}
14
14
15
- public async executeRefreshRequest ( device : Mobile . IiOSDevice , appId : string ) : Promise < boolean > {
15
+ public async executeRefreshRequest ( device : Mobile . IiOSDevice , timeout : number , appId : string ) : Promise < boolean > {
16
16
const deviceId = device . deviceInfo . identifier ;
17
17
const mainRequestName = this . $iOSNotification . getRefreshRequest ( appId ) ;
18
- const readyRequestName = this . $iOSNotification . getAppRefreshStarted ( appId ) ;
19
- const timeout = 5 ;
18
+ const refreshRequestStartedName = this . $iOSNotification . getAppRefreshStarted ( appId ) ;
20
19
21
- const result = await this . executeRequest ( mainRequestName , readyRequestName , appId , deviceId , timeout ) ;
20
+ const result = await this . executeRequest ( mainRequestName , refreshRequestStartedName , appId , deviceId , timeout ) ;
22
21
23
22
return result ;
24
23
}
25
24
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 > {
27
26
let isSuccessful = false ;
28
27
29
28
try {
30
29
// We should create this promise here because we need to send the ObserveNotification on the device
31
30
// 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 ) ;
33
32
const notificationPromise = this . $iOSNotificationService . awaitNotification ( deviceId , + socket , timeout ) ;
34
33
await this . $iOSNotificationService . postNotification ( deviceId , mainRequestName ) ;
35
34
await notificationPromise ;
0 commit comments