()
| 309 | // poison the write queue — a missed heartbeat must never degrade an |
| 310 | // otherwise healthy spool. |
| 311 | touch(): Promise<void> { |
| 312 | if (this.disposed || this.writeError) { |
| 313 | return Promise.resolve(); |
| 314 | } |
| 315 | |
| 316 | const operation = this.pendingWrite.then(async () => { |
| 317 | if (this.disposed || this.writeError) return; |
| 318 | const updatedSession = { |
| 319 | ...this.session, |
| 320 | updatedAt: Date.now(), |
| 321 | } satisfies RecordingSpoolSessionRecord; |
| 322 | await this.backend.createSession(updatedSession); |
| 323 | this.session = updatedSession; |
| 324 | }); |
| 325 | this.pendingWrite = operation.then( |
| 326 | () => undefined, |
| 327 | () => undefined, |
| 328 | ); |
| 329 | |
| 330 | return operation.catch(() => undefined); |
| 331 | } |
| 332 | |
| 333 | async flush() { |
| 334 | await this.pendingWrite; |
no test coverage detected