Bug 408433 - Amount of files in session folder increases after every restoring of session
Summary: Amount of files in session folder increases after every restoring of session
Status: CONFIRMED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Session Management (show other bugs)
Version: 5.27.9
Platform: Arch Linux Linux
: NOR normal
Target Milestone: 1.0
Assignee: Unassigned bugs mailing-list
URL:
Keywords: usability
: 404236 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-06-07 21:46 UTC by Piotr Mierzwinski
Modified: 2024-11-09 17:39 UTC (History)
10 users (show)

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


Attachments
list of session files (95.13 KB, text/plain)
2019-06-09 23:11 UTC, Piotr Mierzwinski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Mierzwinski 2019-06-07 21:46:36 UTC
SUMMARY
I have turned on restoring session, and as I mentioned in subject, amount of files increasing at every restoring of session. Since January 17th (this year) just 876 files were collected in folder ~/.config/session.
Is it possible to clean this folder automatically, and left only necessary files. I don't know if this should be handled by Plasma maintainer in my distribution or should be done on Plasma side (plasmashell).

STEPS TO REPRODUCE
1. turn on restore session
2. run couple applications
3. log out
4. log in
Repeat last two steps several time.

OBSERVED RESULT
Increasing amount of files in ~/.config/session folder

EXPECTED RESULT
Folder ~/.config/session should contain only necessary files and not all including historical files, which will be probably never used in the future.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: YES
(available in About System)
KDE Plasma Version: 5.15.5
KDE Frameworks Version: 5.58.0
Qt Version: 5.12.3

ADDITIONAL INFORMATION
Comment 1 Piotr Mierzwinski 2019-06-07 21:49:29 UTC
I reported this issue in Bug 384392, but seems has not been considered and bug report just closed, because mainly was related with restoring session not working properly.
Comment 2 David Edmundson 2019-06-09 16:48:39 UTC
Please investigate which files.

It could be an app doesn't correctly supply a cleanup script at which point the fault lies with that app.
Comment 3 Piotr Mierzwinski 2019-06-09 23:11:13 UTC
Created attachment 120741 [details]
list of session files
Comment 4 Piotr Mierzwinski 2019-06-09 23:18:25 UTC
In attachment list of all files which were created since January 17th (this year). On list you can find:
  dolphin kate kdevelop kmix konsole kwin kwrite okular

where only kdevelop appears twice, other occur many times more.

This happened before fixing issue related with incorrectly restoration of session and happens still after this fix.
Comment 5 Piotr Mierzwinski 2019-06-09 23:27:57 UTC
Sorry not only kdevelop, but also kwin seems to be correctly created and removed. For kate are quite old files, obviously because I closed it one day and after alternatively next start it didn't stay till end of session.
Comment 6 Piotr Mierzwinski 2019-06-14 23:16:34 UTC
At June 10th I removed all files from ~/.config/session. Passed couple days. Today I checked this folder I can see that files multiplying for: dolphin, kmix, konsole, kwrite, okular. I didn't check more than I sent in original post.
For kdevelop, kate, kwin seems to handle these files works correctly, because I can see only single file for each of them.
Comment 7 Christoph Feck 2019-06-25 13:41:14 UTC
New information was added; changing status for inspection.
Comment 8 Christoph Feck 2019-06-25 13:41:30 UTC
Changing status.
Comment 9 Patrick Silva 2019-07-18 06:37:43 UTC
*** Bug 404236 has been marked as a duplicate of this bug. ***
Comment 10 Vasiliy Glazov 2020-04-02 18:27:01 UTC
I have the same in Fedora 31/32.
Comment 11 Piotr Mierzwinski 2020-05-06 17:36:15 UTC
Issue still persists.
I have 2106 files in directory and I open (almost every day couple applications).
Comment 12 Brian Kaye 2022-03-21 21:00:20 UTC
I have had this issue for some time on Fedora. The file .config/ksmserverrc seems to have entries for commands that indicate that old session files should be deleted.
Comment 13 Piotr Mierzwinski 2022-03-21 23:52:13 UTC
(In reply to Brian Kaye from comment #12)
> I have had this issue for some time on Fedora. The file .config/ksmserverrc
> seems to have entries for commands that indicate that old session files
> should be deleted.

I experience this issue till today. Could you please tell us which commands needs to add to config/ksmserverrc file that old session files would be deleted?
Comment 14 Brian Kaye 2023-05-18 14:34:54 UTC
I have not deleted files in .config/session for some time. It appears that instances for some files have disappeared. The only one that continues to be added if for systemsettings. I will delete all the files in .config/session today and  see what happens.
Comment 15 Brian Kaye 2023-05-18 15:49:45 UTC
I did a restart twice and files were retained for  twice for systemsettings, kcalc, dolphin, several console sessions, and kpat. These are the ones that were open at the time so I am not sure what other commands are affected. I can understand that it would be wise to keep one copy in case of a system crash.
Comment 16 Brian Kaye 2023-05-18 15:51:53 UTC
I did update to Fedora 38 yesterday.
Comment 17 Brian Kaye 2023-05-18 16:20:01 UTC
Upon further reflection, I wondered it if someone might want to migrate back to an old session  for whatever reason. The system could optionally keep a certain number of old session information and the user could be presented with an option of which one to restore. Perhaps a timer to use the last session configuration like grub2 does on boot and an option to keep old session or not.
Comment 18 Brian Kaye 2023-12-08 22:49:02 UTC
The problem persists in Fedora  39 with plasma-desktop-5.27.9-1.fc39.x86_64. I have  781 files in .config/session.
Comment 19 Andreas Kilgus 2023-12-09 16:10:41 UTC
(In reply to Brian Kaye from comment #17)
> Upon further reflection, I wondered it if someone might want to migrate back
> to an old session  for whatever reason. The system could optionally keep a
> certain number of old session information and the user could be presented
> with an option of which one to restore. Perhaps a timer to use the last
> session configuration like grub2 does on boot and an option to keep old
> session or not.

JFTR: The session files for stopped activities are stored in .config/session, too. So deleting everything in this directory for some kind of clean-up is no good idea if someone makes use of the activity feature (like I do, heavily). But the file counter increases even more for activity users: My .config/session folder contains 23215 files at the time being. That is way too much, even with activities kept in mind.
Comment 20 Brian Kaye 2023-12-09 16:16:54 UTC
I agree that there are situations where keeping old session configs might be useful. I suggest there should be some option to decide how many to retain including all of them an give the use the option of which one to activate.
Comment 21 Brian Kaye 2024-11-09 17:39:34 UTC
Just checked today there were only two files in .config/session. Wonder if the problem is fixed or moved to another location. System is running Fedora 41.