https://bugs.kde.org/show_bug.cgi?id=508506
Bug ID: 508506
Summary: Improve autosave/stashing for unsaved documents to
prevent data loss
Classification: Applications
Product: kate
Version First 25.08.0
Reported In:
Platform: Ubuntu
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: sessions
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
SUMMARY
Currently, stashed and swap files for unsaved documents in Kate are only
updated under specific conditions:
- When a new document tab is opened
- When a document tab is closed
- When the session is manually saved
This behaviour leads to potential data loss if Kate or the system crashes,
because unsaved files do not have continuously updated swap/stash data like
normal saved files do.
STEPS TO REPRODUCE
1. In Settings -> Open/Save -> Advanced:
Enable "Swap file mode" and set the "Save swap files every:" to 5s
2. In Settings -> Session:
Under "Automatically save and restore:" make sure "Newly-created unsaved
files" checkbox is set.
3. In a terminal:
watch 'cat ~/.local/share/kate/stash/Default.katesession/Document*'
4. Create a new file and start typing.
5. Observe in terminal that "Document 1" has been created.
6. Make further updates and observe no change to stash or swap.
7. Open new tab and start typing.
8. Observe Document 1, Document 1 swap and Document 2 updated.
9. Make changes to Document 1 and observe no change.
10. Close Document 2 and observe Document 1 is updated.
11. Make change to Document 1 and save the session (Sessions -> Save session)
12. Observe Document 1 is updated.
EXPECTED RESULT
One or more of the following could mitigate the issue:
- Periodic session saving:
Implement a configurable autosave timer that periodically saves the session
state, including stashed documents.
- CLI argument:
Add a flag such as "kate --save-session" to allow external tools
(cron/systemd/timers) to trigger session saving.
- Improve stash/swap handling:
Make unsaved stashed documents behave like normally saved files, i.e.
continuously updated in the background, so that crashes do not cause data loss.
SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Kubuntu 24.04.3
KDE Plasma Version: 5.27.12
KDE Frameworks Version: 5.115.0
Qt Version: 5.15.13
Kate Version: 25.08.0 (Snap install)
ADDITIONAL INFORMATION
Stashing of unsaved documents was fixed by:
https://invent.kde.org/utilities/kate/-/merge_requests/1578
and is related to these bugs (amongst others):
https://bugs.kde.org/show_bug.cgi?id=274102 (REOPENED)
https://bugs.kde.org/show_bug.cgi?id=353654 (RESOLVED)
https://bugs.kde.org/show_bug.cgi?id=375594 (RESOLVED)
https://bugs.kde.org/show_bug.cgi?id=475210 (RESOLVED)
https://bugs.kde.org/show_bug.cgi?id=504691 (RESOLVED)
--
You are receiving this mail because:
You are watching all bug changes.