()
| 129 | } |
| 130 | |
| 131 | public async testServerNotify(): Promise<void> { |
| 132 | const { reqId, url } = getUniqueUrl(); |
| 133 | const notificationTimeout = config.getMsUntilNextRun() - timeoutBufferMs; |
| 134 | |
| 135 | logger.trace( |
| 136 | { notificationTimeout: `in ${(notificationTimeout / (60 * 1000)).toFixed(1)} minutes` }, |
| 137 | 'Awaiting test notification response', |
| 138 | ); |
| 139 | |
| 140 | // Wait on a promise to be resolved by the web redirect completing |
| 141 | await Promise.all([ |
| 142 | promiseTimeout( |
| 143 | notificationTimeout, |
| 144 | new Promise((resolve, reject) => { |
| 145 | pendingRedirects.set(reqId, this.onTestVisit(resolve, reject).bind(this)); |
| 146 | }), |
| 147 | ), |
| 148 | await this.notify(NotificationReason.TEST, url), |
| 149 | ]); |
| 150 | pendingRedirects.delete(reqId); |
| 151 | } |
| 152 | |
| 153 | public async newDeviceAuthLogin(): Promise<void> { |
| 154 | const { reqId, url } = getUniqueUrl(); |
no test coverage detected