* Example for bounded work started outside Appium's plugin command chain, such as an IPC callback. * Ordinary command handlers, including work after await next(), are already protected by Appium. * The helper suspends idle expiry through retrieval and the session-data update, then resumes it
(driver: DriverLike, fetchData: () => Promise<unknown>)
| 211 | * @see ../test/unit/command-timeout.spec.ts for success, failure, overlap, and idle expiry tests. |
| 212 | */ |
| 213 | async refreshSessionData(driver: DriverLike, fetchData: () => Promise<unknown>): Promise<void> { |
| 214 | await runWithCommandTimeout(driver, async () => { |
| 215 | driver.fakeSessionData = await fetchData(); |
| 216 | }); |
| 217 | } |
| 218 | |
| 219 | async getFakeSessionData(_next: () => Promise<unknown>, driver: DriverLike): Promise<unknown> { |
| 220 | await sleep(1); |
no test coverage detected