(transcriptPath: string)
| 117 | }; |
| 118 | |
| 119 | const handleTranscriptPath = (transcriptPath: string): Promise<void> => { |
| 120 | const setupTask = (pendingScannerSetup ?? Promise.resolve()).then(() => processTranscriptPath(transcriptPath)); |
| 121 | const observedTask = setupTask.catch((error) => { |
| 122 | if (!shuttingDown) { |
| 123 | reportTranscriptSyncFailure(transcriptPath, error); |
| 124 | } |
| 125 | }); |
| 126 | pendingScannerSetup = observedTask.finally(() => { |
| 127 | if (pendingScannerSetup === observedTask) { |
| 128 | pendingScannerSetup = null; |
| 129 | } |
| 130 | }); |
| 131 | return pendingScannerSetup; |
| 132 | }; |
| 133 | |
| 134 | const handleSessionHook = (sessionId: string, data: Record<string, unknown>): void => { |
| 135 | if (shuttingDown) { |
no test coverage detected