fix(close): acknowledge document save before session snapshot - #77
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bc3c374e23
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (!saved || isDirty() || !flushSessionSnapshot) return; | ||
| try { | ||
| await flushSessionSnapshot(); |
There was a problem hiding this comment.
Keep snapshot writes out of the close commit queue
When session persistence is the slow or stalled operation this change is intended to tolerate, invoking flushSessionSnapshot() immediately after the ACK still submits session:write to the main process. That write enters SessionQueue, and the subsequent removeSessionWindows or commitQuitSession operation enters the same queue behind it, so the close transaction still waits for the supposedly best-effort flush—now without the renderer-save deadline. A stalled session write can therefore leave window close or app quit pending indefinitely; defer or omit this snapshot write, or ensure it cannot block the authoritative close commit.
AGENTS.md reference: AGENTS.md:L15-L15
Useful? React with 👍 / 👎.
| @@ -0,0 +1,50 @@ | |||
| type CloseSaveResult = { | |||
There was a problem hiding this comment.
Recreate the commit with the required project820 identity
The reviewed commit records both author and committer as Codex <codex@openai.com>, while this repository requires every commit to use the project820 GitHub noreply identity. Recreate the commit under the required identity before it is submitted.
AGENTS.md reference: AGENTS.md:L9-L9
Useful? React with 👍 / 👎.
변경 내용
종료 시 문서 저장 ACK가 세션 복구 스냅샷 flush 완료까지 지연되어, 정상 종료가 저장 응답 deadline에 걸리는 경로를 분리했습니다.
원인
기존 renderer close-save handler가
docLifecycle.save()이후sessionSnapshot.flushSessionSnapshot()까지 await한 다음에만 save result를 전송했습니다. 복구 스냅샷 쓰기가 느리거나 실패하면 main process가 문서 저장 성공을 확인하지 못해 종료 트랜잭션이 deadline에 도달했습니다.검증
npm test— 150 files, 2442 tests passednpm run typecheck— passednpm run build— passednpm run test:close-dialog-smoke— discard/save/cancel, quit-cancel/quit-discard/quit-save, large discard/save, shutdown restore, file-failure restore passednpm run preflight:tessdata— passednpm run test:security-e2e— passednpm run test:converter-e2e— passednpm run test:html-export-direct— passednpm run test:roundtrip-smoke— passednpm run knip— passednpm audit --omit=dev --audit-level=high— existing dependency audit reports 14 vulnerabilities (8 high); this PR changes no dependency or lockfileCloses #76