SUMMARY One day I prepare my session ("mySession2), so open two files and one "untilted"(where I put something). Happens update of system. I do it (as installation after restart), power off. Next day I login to Plasma, Kate starts but without opened files. To be clear there is only couple empty "untilted". BTW. Option in menu "File -> Open recent" is disabled (because empty list). This is really annoying, because every day or max evey 2 days I need to open again the same files. STEPS TO REPRODUCE 1. Start Kate 2. Open two text files 3. Click "New" to have new untilted document 4. Put something into new document 5. Save as session "mySession2" 6. Make update 7. Make restart of PC OBSERVED RESULT No files opened which were saved in session EXPECTED RESULT Files saved in session should be opened SOFTWARE/OS VERSIONS Linux/KDE Plasma: KDE Plasma Version: 6.1.90 KDE Frameworks Version: 6.7.0 Qt Version: 6.7.2 ADDITIONAL INFORMATION Neon unstable edition
Created attachment 174123 [details] kate lost session
Created attachment 174124 [details] missing recent files
I thought it has fixed already, because through few days (I think 3 Kate was restoring the session). Unfortunately today (fourth day) I found no documents opened. In documents view I found only one empty "untilted" and recent option is disabled (because the list is empty). Therefore I consider that restore session in Kate doesn't work well, for sure it is not reliable.
Need an easier way to reproduce this. When this happens next, can you check what's in your ~/.local/share/kate/stash/SESSION_NAME_HERE directory.
Today, after login to Plasma I met no restored session (and no recent) in Kate (is present only empty "untilted"). $ pwd piotr@Dell:/home/piotr/.local/share/kate/stash/mySession2.katesession piotr@Dell:~/.local/share/kate/stash/mySession2.katesession$ ls -l total 28 -rw-rw-r-- 1 piotr piotr 20 wrz 19 02:32 'Document 0' -rw-rw-r-- 1 piotr piotr 152 wrz 19 02:32 'Document 0~' -rw-rw-r-- 1 piotr piotr 18 paź 4 02:06 'Document 2' -rw-rw-r-- 1 piotr piotr 95 paź 3 00:35 'Document 2~' -rw-rw-r-- 1 piotr piotr 13 wrz 19 02:33 'Document 3' -rw-rw-r-- 1 piotr piotr 364 wrz 19 02:32 'Document 3~' -rw-rw-r-- 1 piotr piotr 122 sie 31 03:41 'Document 4' BTW. Documents in stash don't look like those I had opened recently. It looks like some old state of session. To be clear. At October, 2-nd (so when sent last post) I met no restored session in Kate, despite in title bar was name of my session, so I opened again documents I usually work with. Today again the same situation - no restored session in Kate. Only on activity I've done was updating one document (and save) - it was normal file (not untilted).
How do you quit Kate? Do you quit it even?
(In reply to Waqar Ahmed from comment #6) > How do you quit Kate? Do you quit it even? No, I don't quit Kate manually.
> How do you quit Kate? Do you quit it even? No, I don't quit Kate manually. Plasma close all running application. I use restore session of Plasma, so why I would need to quit Kate manually.
> why I would need to quit Kate manually because it might not quit correctly and then you risk loosing your session data, like the stashed untitled documents that you keep loosing
(In reply to Waqar Ahmed from comment #9) > > why I would need to quit Kate manually > > because it might not quit correctly and then you risk loosing your session > data, like the stashed untitled documents that you keep loosing Anyway this is bug, IMHO. Not sure if in Kate or in "restore session", but bug. I don't remember if this works well in X11 and this is only issue in Wayland session, or also in X11 works not well. Tell me please if you know. And please, I don't want to remember everyday to close Kate to don't lose the session, if I have (in Plasma) option "restore session" turned on. IMHO manual quit is like going to back to the past, whereas Plasma/KDE is adverted like modern environment :/. BTW. I'm waiting till real restore session will be implemented in Plasma, because current is, let say, clumsy.
> Anyway this is bug, IMHO Kind of, yeah. IIRC we don't save untitled documents (lets call them "stash docs") periodically. So this needs to be done. Our session is saved every 5 seconds whenever a document changes, so we just need to save "stash docs" as well. This doesn't have anything to do with x/wayland etc.
(In reply to Waqar Ahmed from comment #11) > > Anyway this is bug, IMHO > > Kind of, yeah. For me without a doubt this is a bug. Kate losts session randomly if user don't quit it (Kate) manually. In my session I have 2 regular files and one "untilted". The files from my subdirectory "mySession2.katesession" doesn't reflect files what usually I have open. I open my 3 files in mentioned session, it (session) lives couple days and disappears. BTW. Today Kate again lost session. Please consider that such thing doesn't happen in Notepad++ (working on Windows), or I didn't meet it yet and I use it in my job since dozen of a years. > IIRC we don't save untitled documents (lets call them "stash docs") periodically. > So this needs to be done. Our session is saved every 5 > seconds whenever a document changes, so we just need to save "stash docs" as > well. Yes, I agree. I have this option turned on (save every 5 sec.), but seems to session as is seems to be incorrectly saved/or not saved if Kate is stopped/killed by Plasma. > This doesn't have anything to do with x/wayland etc. I've heard/read somewhere some times ago (maybe some kde blog) that the issue coming from plasma, which kill Kate in moment of shutdown/restart. And is hard to support this and then save session.
> I've heard/read somewhere some times ago (maybe some kde blog) that the issue coming from plasma, which kill Kate in moment of shutdown/restart. And is hard to support this and then save session. That might be true. I will try to improve the stability in the coming days, it would be great if you can rigorously test this. We need to make this feature stable and reliable enough for daily use. Otherwise the option is totally useless.
The full stashing feature is not that well tested. In a perfect world me would just always create a dummy file for untitled stuff. Them we even would have swap files for crash recovery.
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kate/-/merge_requests/1620
Git commit 519037af35316007d8aba5424d720abc08390f93 by Christoph Cullmann, on behalf of Waqar Ahmed. Committed on 17/10/2024 at 10:05. Pushed by cullmann into branch 'master'. include stash docs when auto saving M +0 -1 apps/lib/kateapp.cpp M +0 -2 apps/lib/katemainwindow.cpp M +5 -0 apps/lib/session/katesessionmanager.cpp https://invent.kde.org/utilities/kate/-/commit/519037af35316007d8aba5424d720abc08390f93
Sorry, but this still doesn't work. I had created a session. Today I found two "Untilted" (second one I could even not close by close button, so I closed first one). I opened two regular files, and two "Untilted" where I put some text. I made update, restarted PC, logged in to Plasma and found Kate with one empty "Untilted", so seems to be worse than earlier. I'm not sure if the fix made at 2024-10-17 was applied in my system before today test. I don't know how to check this. I just update system every day. piotr@Dell:~$ cd /home/piotr/.local/share/kate/stash/mySession2.katesession piotr@Dell:~/.local/share/kate/stash/mySession2.katesession$ ll total 28 -rw-rw-r-- 1 piotr piotr 20 wrz 19 02:32 'Document 0' -rw-rw-r-- 1 piotr piotr 152 wrz 19 02:32 'Document 0~' -rw-rw-r-- 1 piotr piotr 84 paź 24 00:37 'Document 2' -rw-rw-r-- 1 piotr piotr 187 paź 24 00:37 'Document 2~' -rw-rw-r-- 1 piotr piotr 59 paź 24 00:37 'Document 3' -rw-rw-r-- 1 piotr piotr 13 paź 24 00:37 'Document 3~' -rw-rw-r-- 1 piotr piotr 122 sie 31 03:41 'Document 4' Please consider that "Document 2" and "Document 3" are the my both "Untilted" (I checked content), what I left before restart of PC. And unfortunately they were not restored. As I said I met Kate with one empty "Untilted".
Did you check whether kate had opened the needed session, maybe it was some other session? We save the session every ~5 seconds WHENEVER a new doc is created or closed so I can't see why its failing. Why this happens now is beyond me atm, can't see why it would fail.
> Please consider that "Document 2" and "Document 3" are the my both "Untilted" (I checked content), If the content is there then can we say that there was no content loss?
(In reply to Waqar Ahmed from comment #18) > Did you check whether kate had opened the needed session, maybe it was some > other session? We save the session every ~5 seconds WHENEVER a new doc is > created or closed so I can't see why its failing. I can see session name in title bar, so I'm sure that Kate opened correct one. I will attach screenshot. Yesterday I did the same what at the day before yesterday, and result was the same - I met "mySession2" as empty. piotr@Dell:~$ cd /home/piotr/.local/share/kate/stash/mySession2.katesession piotr@Dell:~/.local/share/kate/stash/mySession2.katesession$ ll total 28 -rw-rw-r-- 1 piotr piotr 20 wrz 19 02:32 'Document 0' -rw-rw-r-- 1 piotr piotr 152 wrz 19 02:32 'Document 0~' -rw-rw-r-- 1 piotr piotr 306 paź 24 01:56 'Document 2' -rw-rw-r-- 1 piotr piotr 84 paź 24 01:56 'Document 2~' -rw-rw-r-- 1 piotr piotr 59 paź 24 00:37 'Document 3' -rw-rw-r-- 1 piotr piotr 13 paź 24 00:37 'Document 3~' -rw-rw-r-- 1 piotr piotr 122 sie 31 03:41 'Document 4' And again 'Document 2' and 'Document 3' have correct content, only have not been reopened. BTW. Maybe session should be also saved at the moment when Kate is closed manually and when is killed, otherwise something could be lost. > Why this happens now is beyond me atm, can't see why it would fail. Maybe you could add some more debug messages (triggered on some env.variable), or even you could send binary and I could run it and send you such report.
Created attachment 175197 [details] kate-session-no_docs
(In reply to Waqar Ahmed from comment #19) > > Please consider that "Document 2" and "Document 3" are the my both "Untilted" (I checked content), > > If the content is there then can we say that there was no content loss? Yes, only documents were not opened in the restored session.
Created attachment 175261 [details] multiply "Untilted" Couple days ago I reported lost session in Kate. Next day "Documents" view was empty, or actually one was present only one "Untilted", today I have several "Untilted" ("Untitled (2)", "Untitled (3)"...) - check attached screenshot "multiply "Untilted", so seems appearing several "Untilted", after restart of Kate is still not fixed. This is another case for Bug 468573, where user quit Kate manually and here Plasma kill Kate and restore it. Please notice I start my PC every day, today (Saturday) I started twice.
Created attachment 175262 [details] kate - "Manage Sessions" BTW. In "Manage Sessions" I cannot remove "mySession2". Button "Delete" is from some reason not available (is "grayed"). Before I opened "Manage Sessions" I closed all duplicated Untilted (left one).
(In reply to Piotr Mierzwinski from comment #24) > Created attachment 175262 [details] > kate - "Manage Sessions" > > BTW. In "Manage Sessions" I cannot remove "mySession2". Button "Delete" is > from some reason not available (is "grayed"). Before I opened "Manage > Sessions" I closed all duplicated Untilted (left one). Ok. I understand. Because this is currently opened. I removed that session, after I created and opened another one "mySession3". And here opened 3 documents: two regular files and one Untilted. I will see tomorrow (Sunday) if session will be restored.
Today again Documents view is empty (is present only one new Untilted). Seems creating new session and open here documents only confirmed that the problem with restore session persists. I"m not sure why anybody cannot reproduce the issue. Maybe I didn't clicked proper options in settings?
I dont think many people are trying and I am not an active user of sessions or plasma restore. I rarely shutdown my pc. Can you reproduce the issue if you kill kate and start again? it must be sigkill, Kate handles other signals and tries to shutdown gracefully.
(In reply to Waqar Ahmed from comment #27) > I dont think many people are trying and I am not an active user of sessions > or plasma restore. I rarely shutdown my pc. so instead do you put your computer to sleep? > Can you reproduce the issue if you kill kate and start again? > it must be sigkill, Kate handles other signals and tries to shutdown > gracefully. I killed kate by SIGKILL, and run it using Kicker. In result session was restored only I lost content of "Untilted" (appeared empty). I did it twice with the same result. Also tried with default signal, so TERM and worked well. I don't know how plasmashell closes its children, maybe this is some specific way what is not supported by kate?
Today (Saturday) surprise, so all have been restored correctly (including 2 "Untilted"). We will see tomorrow.
(In reply to Piotr Mierzwinski from comment #29) > Today (Saturday) surprise, so all have been restored correctly (including 2 > "Untilted"). We will see tomorrow. Also it worked well at Sunday and Monday. Unfortunately today I met empty Documents list (except one empty "Untilted") :( The only difference was that I did nothing in Kate since last days. I'm not sure if solution implemented in Kate is reliable.
There are bugs still, yes. It would help more if the bug report contains exact steps to reproduce the issue quickly. That way it is likely that it will get fixed soon. With a generic report "i have a problem that happens", things will take a while because someone needs to put in the effort and find how exactly the bug happens before fixing it. There are probably cases still left where session is not saved properly.