Bug 507741 - [Wishlist] Backup corrupted session on error
Summary: [Wishlist] Backup corrupted session on error
Status: RESOLVED DUPLICATE of bug 478698
Alias: None
Product: kate
Classification: Applications
Component: sessions (other bugs)
Version First Reported In: 25.04.1
Platform: Microsoft Windows Microsoft Windows
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-08-01 13:22 UTC by qclab
Modified: 2025-09-03 10:32 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 qclab 2025-08-01 13:22:11 UTC
Currently, if an error occurs during session loading, the corrupted session is overwritten with a blank session. This complicates troubleshooting as well as any recovery efforts. 

If Kate cannot load a session, it should create a backup by renaming the session file before reverting to a blank session.
Comment 1 Waqar Ahmed 2025-08-04 07:48:03 UTC
> Currently, if an error occurs during session loading, the corrupted session is overwritten with a blank session

What do you mean by "an error occurs during session loading"? Which error occurred? Do you have a sample katesession file?
Comment 2 Waqar Ahmed 2025-08-14 19:09:26 UTC
status change
Comment 3 Bug Janitor Service 2025-08-29 03:47:50 UTC
๐Ÿ›๐Ÿงน โš ๏ธ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME.

For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging.

Thank you for helping us make KDE software even better for everyone!
Comment 4 qclab 2025-08-29 13:10:05 UTC
I cannot provide a sample due to being on a windows machine and the aforementioned session file overwriting. No error was reported, but a blank session would occasionally open instead of the desired one.
No longer experiencing this in 25.11.70. Closing.
Comment 5 qclab 2025-08-29 22:07:04 UTC
I spoke too soon.
This request would help to troubleshoot a problem that presents with similar symptoms to Bug 470293 and Bug 508494. 
A session is reopened but displays no files or any other customization.

It can be simulated by setting Count=0 for [Open MainWindows] in a previously saved session file.
Possibly the problem lies in session saving, but the session file is overwritten when reopened.

To aid with this, I propose two alternatives to create a backup session file:
1)
If Count=0 in [Open MainWindows] or [Open Documents].

2)
Before loading any session.

Though this will not resolve the underlying problem, my hope is that it will ease troubleshooting.
Comment 6 Waqar Ahmed 2025-08-29 22:16:11 UTC
That is a different bug.

> It can be simulated by setting Count=0 for [Open MainWindows] in a previously saved session file

We do not support manual modifications on the config file. So such a simulation is useless, unless Kate is setting Count to 0

The thing that is needed is some concrete way to reproduce the problem.
Comment 7 qclab 2025-09-02 14:09:29 UTC
(In reply to Waqar Ahmed from comment #6)
> We do not support manual modifications on the config file. So such a
> simulation is useless, unless Kate is setting Count to 0

Yes, Kate sets:
[Open Documents]
Count=0

[Open MainWindows]
Count=0

> The thing that is needed is some concrete way to reproduce the problem.

Correct, but as the afflicted session file is overwritten, even determining where to start is mostly luck.
Comment 8 Waqar Ahmed 2025-09-03 10:32:31 UTC
Since this is a session bug, I am marking it as a dupe.

*** This bug has been marked as a duplicate of bug 478698 ***