Repository navigation
feat: let apps flush their content before saving - #4219
Merged
Merged
Conversation
Member
Author
|
convertig to draft, not relevant for the production release |
AlexAndBear
force-pushed
the
feat/app-flush-content-callback
branch
from
November 9, 2026 11:32
374b462 to
fb7ca9f
Compare
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 38 |
| Duplication | 2 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
AlexAndBear
marked this pull request as ready for review
November 24, 2026 10:48
Assisted-by: Claude Code:claude-opus-5-5
Flush the app inside saveFileTask, so a leave or another save waits for a save that is still flushing instead of asking about or saving the same changes again. Forget the flush callback when the app is remounted for another file. Assisted-by: Claude Code:claude-opus-5-5
Assisted-by: Claude Code:claude-opus-5-5
AlexAndBear
force-pushed
the
feat/app-flush-content-callback
branch
from
November 24, 2026 12:03
fb7ca9f to
40739d8
Compare
JammingBen
approved these changes
Nov 24, 2026
2 of 7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
register:onFlushContentCallback. AppWrapper runs it as part of every save (save button,Ctrl+S, autosave, the unsaved changes dialog, download and delete) and before it decides about unsaved changes (closing, leaving the app) or "Save as". So apps that only write their content on demand, like the PDF viewer, always get their latest state saved, without intercepting the save button or the keyboard shortcut themselves.Related Issue
How Has This Been Tested?
Ctrl+S, autosave, download, "Save as" and leaving the app, and its content is what gets saved; a failing callback drops the save and still asks on close; save then leave while the flush is pending gives one PUT and no dialog; an idle autosave tick saves nothing; a stale callback isn't called after the app switched filesCtrl+Swhile typing, typing during a slow save stays unsaved, drawing then closing, save then close right away on a slow machine, download and "Save as" right after an edit, delete after an edit, form scripts, read-only, one PUT eachCtrl+Swhile typing, autosave with and without changes, unsaved changes dialog, download, "Save as" and delete with unsaved changes, collaborative editing with two users; Apollon save and closeTypes of changes