Skip to content

fix: save unsaved changes before deleting the open file - #3783

Merged
JammingBen merged 4 commits into
mainfrom
fix/editor-delete-dirty
Oct 26, 2026
Merged

JammingBen merged 4 commits into
mainfrom
fix/editor-delete-dirty

Conversation

@AlexAndBear

@AlexAndBear AlexAndBear commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Description

  • Deleting the open file with unsaved changes: the changes are saved first, then the file goes to the trash bin, so the trashed (and restored) file has your latest edits. No "Unsaved changes" dialog afterwards.
  • If saving isn't possible (error or the file was changed outside this window): the file isn't deleted and your edits stay in the editor, with a message saying why.
  • Download with unsaved changes: no longer hangs while a save is running, and a failed save isn't reported as "File autosaved".

Related Issue

How Has This Been Tested?

  • test environment: unit tests (Vitest), browser tests (Playwright) against a local OpenCloud
  • test case 1: unit: save before delete, delete skipped when the save fails or the file is conflicted, waiting for a running save, no saves and no dialog after the delete, state reset on file change (also when the same file comes back via undo), download before/after save
  • test case 2: browser: .txt and .md on desktop and Pixel 7, delete right after typing, restore via undo, Ctrl+Z and trash bin, failed and aborted save, Ctrl+S racing the delete, conflict from outside, clean file, download, next file after a delete, preview with several images

Types of changes

  • Bugfix
  • Enhancement (a change that doesn't break existing code or deployments)
  • Breaking change (a modification that affects current functionality)
  • Technical debt (addressing code that needs refactoring or improvements)
  • Tests (adding or improving tests)
  • Documentation (updates or additions to documentation)
  • Maintenance (like dependency updates or tooling adjustments)

@AlexAndBear
AlexAndBear marked this pull request as draft October 19, 2026 13:59
@AlexAndBear

Copy link
Copy Markdown
Member Author

need to decide on the workflow -> so we don't have data loss

@AlexAndBear
AlexAndBear marked this pull request as ready for review October 23, 2026 12:42
@AlexAndBear

Copy link
Copy Markdown
Member Author

need to decide on the workflow -> so we don't have data loss

Decided on save before delete

@AlexAndBear
AlexAndBear force-pushed the fix/editor-delete-dirty branch from aacf0aa to 6b79710 Compare October 24, 2026 20:29
@AlexAndBear AlexAndBear changed the title fix: don't ask to save a file after it was deleted fix: save unsaved changes before deleting the open file Oct 24, 2026
@JammingBen
JammingBen merged commit 91aa7cf into main Oct 26, 2026
27 checks passed
@JammingBen
JammingBen deleted the fix/editor-delete-dirty branch October 26, 2026 09:17
@openclouders openclouders mentioned this pull request Oct 26, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deleting the open file with unsaved changes asks to save it only after it is deleted

2 participants