Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Bug]: Save and Close drops edits made while the write is pending #20482

Description

@scttbnsn

Operating system

macOS (automated regression test)

Orca version

1.4.197, main at fe4237c

Details

With autosave off, Save and Close can delete edits made while the file write is pending. The dialog dismisses before the write finishes, so the editor remains usable. The save queue preserves newer text as a dirty draft, but the close handler then closes the tab unconditionally and deletes that draft.

Trigger:

  1. Disable autosave, edit a file, and close its tab.
  2. Choose Save in the confirmation dialog.
  3. While the write is pending, type more text or delete the file's contents. A slow SSH write makes this window easier to hit.
  4. Let the earlier write finish. The tab closes with only the earlier text saved, and the newer draft is gone.

Expected: save the newer edits too, or keep the tab and draft open for another save decision.

I reproduced this with the real autosave controller, save queue, and editor store, deferring the filesystem bridge write. The regression test also covers edits still buffered by the rich editor's flush callback. All three cases fail because the tab closes. Normal save-and-close and write-failure cases pass. This is automated source-level reproduction, not a live SSH UI test.

The unconditional close is in editor-autosave-controller.ts.

Related but different: #1237 covered a missing save prompt; #18376 fixes a save-quiesce request that never settles. This race happens after the user accepts the save prompt and the write completes successfully.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions