(
sessionId: UUID,
)
| 1283 | */ |
| 1284 | private existingSessionFiles = new Map<string, string>() |
| 1285 | private async getExistingSessionFile( |
| 1286 | sessionId: UUID, |
| 1287 | ): Promise<string | null> { |
| 1288 | const cached = this.existingSessionFiles.get(sessionId) |
| 1289 | if (cached) return cached |
| 1290 | |
| 1291 | const targetFile = getTranscriptPathForSession(sessionId) |
| 1292 | try { |
| 1293 | await stat(targetFile) |
| 1294 | this.existingSessionFiles.set(sessionId, targetFile) |
| 1295 | return targetFile |
| 1296 | } catch (e) { |
| 1297 | if (isFsInaccessible(e)) return null |
| 1298 | throw e |
| 1299 | } |
| 1300 | } |
| 1301 | |
| 1302 | private async persistToRemote(sessionId: UUID, entry: TranscriptMessage) { |
| 1303 | if (isShuttingDown()) { |
no test coverage detected