Skip to content

fix(close): acknowledge document save before session snapshot - #77

Merged
project820 merged 1 commit into
mainfrom
fix/close-flow-save-timeout
Aug 10, 2026
Merged

fix(close): acknowledge document save before session snapshot#77
project820 merged 1 commit into
mainfrom
fix/close-flow-save-timeout

Conversation

@project820

Copy link
Copy Markdown
Owner

변경 내용

종료 시 문서 저장 ACK가 세션 복구 스냅샷 flush 완료까지 지연되어, 정상 종료가 저장 응답 deadline에 걸리는 경로를 분리했습니다.

  • 문서 저장 성공 ACK를 먼저 main process에 전달합니다.
  • 세션 스냅샷 flush는 ACK 이후 best-effort로 수행하고 실패를 경고 로그로 남깁니다.
  • renderer state/save/authorize/consume timeout에 request ID, webContents ID, timeout을 기록합니다.
  • close smoke에 quit-save와 대용량 문서 discard/save 검증을 추가하고, virtualized editor의 대용량 저장 검증을 파일 내용 기준으로 안정화했습니다.
  • close-save handshake 단위 테스트와 renderer timeout 로그 회귀 테스트를 추가했습니다.

원인

기존 renderer close-save handler가 docLifecycle.save() 이후 sessionSnapshot.flushSessionSnapshot()까지 await한 다음에만 save result를 전송했습니다. 복구 스냅샷 쓰기가 느리거나 실패하면 main process가 문서 저장 성공을 확인하지 못해 종료 트랜잭션이 deadline에 도달했습니다.

검증

  • npm test — 150 files, 2442 tests passed
  • npm run typecheck — passed
  • npm run build — passed
  • npm run test:close-dialog-smoke — discard/save/cancel, quit-cancel/quit-discard/quit-save, large discard/save, shutdown restore, file-failure restore passed
  • npm run preflight:tessdata — passed
  • npm run test:security-e2e — passed
  • npm run test:converter-e2e — passed
  • npm run test:html-export-direct — passed
  • npm run test:roundtrip-smoke — passed
  • npm run knip — passed
  • npm audit --omit=dev --audit-level=high — existing dependency audit reports 14 vulnerabilities (8 high); this PR changes no dependency or lockfile

Closes #76

@project820
project820 marked this pull request as ready for review August 10, 2026 07:17
@project820
project820 merged commit 282e3f7 into main Aug 10, 2026
1 check passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +44 to +46
if (!saved || isDirty() || !flushSessionSnapshot) return;
try {
await flushSessionSnapshot();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 = {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: Save 종료 후 창이 남는 close-flow timeout

1 participant