Bug 503083 - Newly-created unsaved files are not preserved on crash
Summary: Newly-created unsaved files are not preserved on crash
Status: RESOLVED DUPLICATE of bug 493665
Alias: None
Product: kate
Classification: Applications
Component: sessions (other bugs)
Version First Reported In: 23.08.5
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-04-20 23:05 UTC by mpeter.68m0y
Modified: 2025-04-21 05:07 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mpeter.68m0y 2025-04-20 23:05:25 UTC
SUMMARY

Some terms I used:
- unsaved document: a new Kate editor tab with some text content, that the user did not explicitely save into a file on the filesystem
- preserve: Kate saving the document's unsaved parts to an internal directory

Lets assume that the following settings are enabled:
- Open/Save > Advanced > Swap file mode: Enabled, Store In Default Directory
- Session > Application Startup/Shutdown Behavior > Automatically save and restore: Newly-created unsaved files

If the user creates a new document or more, writes something in it, but does not save it to a file in the filesystem (because they intend it as a temporary note or something of that sort), Kate does not try to preserve it for when a crash might happen.

STEPS TO REPRODUCE
1. Open Kate, load a saved session
2. Create new documents, write something into them
3. Make the system crash, or simulate a crash with SIGKILL to Kate
4. On next boot, open the Kate session used in step 1
5. Find the unsaved documents in the "Documents" side panel on the left, and open them

OBSERVED RESULT

The opened, unsaved documents are empty.

EXPECTED RESULT

The opened, unsaved documents should preserve their content from before the crash.
This is already what happens if Kate is closed gracefully, even if the user did not explicitly save the session in the "Sessions" toolbar menu.

SOFTWARE/OS VERSIONS
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: openSUSE Leap 15.6
KDE Plasma Version: 5.27.11
KDE Frameworks Version: 5.115.0
Qt Version: 5.15.12

ADDITIONAL INFORMATION

It seems Kate already preserves these unsaved files to some extent, as even after a crash they will appear as files in the Documents panel, with names like "Untitled", "Untitled (1)" and so on.
Comment 1 Waqar Ahmed 2025-04-21 04:58:28 UTC
You are using an unsupported version, consider upgrading. The newer version has improved this feature a bit, but its not 100%stable yet. I will mark as dupe of another older ticket about this feature

*** This bug has been marked as a duplicate of bug 493665 ***
Comment 2 Waqar Ahmed 2025-04-21 05:07:21 UTC
Snap/Flatpaks are available if you want to use a newer version.