Skip to content

fix: pr-bug-scan validated finding from #4499#4739

Open
buf0-bot[bot] wants to merge 1 commit into
mainfrom
bot/pr-bug-scan-4499-1780718059
Open

fix: pr-bug-scan validated finding from #4499#4739
buf0-bot[bot] wants to merge 1 commit into
mainfrom
bot/pr-bug-scan-4499-1780718059

Conversation

@buf0-bot
Copy link
Copy Markdown
Contributor

@buf0-bot buf0-bot Bot commented Jun 6, 2026

Automated fix-PR from pr-bug-scan for parent #4499.

Fixer status: FIXED_WITH_CODE_PROOF
Summary: Restore continueOnSaveFailure branch in prepareRendererForAppRestart; updater.quitAndInstall now logs and proceeds when hot-exit backup rejects.
Blocked proof link: src/preload/index.ts:209-212 prepareRendererForAppRestart re-throws on requestEditorHotExitBackup rejection
Typecheck: skipped

Proof (from validator)

  • C1 — proof_type: code_analysis
    • trigger: User has a dirty diff/conflict tab open (e.g. an unstaged-diff editor with edits) and clicks 'Quit and install update'.
    • observable: updater:quitAndInstall IPC is never invoked; the pending downloaded update does not install and the user remains on the old version.
    • path:
      • src/preload/index.ts:2105 quitAndInstall calls prepareRendererForAppRestart without continueOnSaveFailure
      • src/preload/index.ts:209-212 prepareRendererForAppRestart re-throws on requestEditorHotExitBackup rejection (no more catch-and-warn branch)
      • src/renderer/src/components/editor/editor-autosave-controller.ts:265 handlePrepareHotExit rejects with 'Some unsaved editor changes cannot be backed up before restart.' for any dirty file whose mode !== 'edit'
      • src/preload/index.ts:2110 quitAndInstall catches the thrown error, dispatches ABORTED, and re-throws
  • C2 — proof_type: code_analysis
    • trigger: Session hydration threw earlier (hydrationSucceeded=false), the user has continued editing and has at least one dirty edit-mode tab, then triggers app restart or quit-and-install.
    • observable: Restart fails with a user-visible error toast; no path to recover dirty edits via restart.
    • path:
      • src/preload/index.ts:2105 prepareRendererForAppRestart → requestEditorHotExitBackup
      • src/renderer/src/components/editor/editor-autosave-controller.ts:278 dirtyFiles.length > 0 && !shouldPersistWorkspaceSession(state) branch
      • src/renderer/src/lib/workspace-session.ts:26 shouldPersistWorkspaceSession returns false when hydrationSucceeded is false
      • editor-autosave-controller.ts:281 detail.reject('Unsaved editor changes cannot be backed up until workspace restore finishes.')
      • src/preload/index.ts:210 prepareRendererForAppRestart re-throws → restart/update aborted

Generated by pr-bug-scan (proof-machine architecture). Human approval required before merge.

Restore continueOnSaveFailure branch in prepareRendererForAppRestart; updater.quitAndInstall now logs and proceeds when hot-exit backup rejects.
Copy link
Copy Markdown
Contributor

@pullfrog pullfrog Bot left a comment

Choose a reason for hiding this comment

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

Reviewed changes — restores a continueOnSaveFailure bypass in the hot-exit backup path so that quitAndInstall proceeds even when editor-state backup fails, preventing a downloaded update from getting stuck behind unrecoverable editor state.

  • Add continueOnSaveFailure / saveFailureLogPrefix to AppRestartPrepOptions — optional fields that let callers control whether backup failures abort the restart.
  • Guard the abort/rethrow in prepareRendererForAppRestart behind continueOnSaveFailure — when the flag is set, a console.warn replaces the abort path.
  • Wire quitAndInstall to continue on save failure — passes continueOnSaveFailure: true and a descriptive log prefix so the update install isn't blocked. The app.restart path remains unmodified and still aborts on failure.

✅ No new issues found.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

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.

0 participants