If power cut occurs, which is a nightmare for PCs (excluding laptops with battery), Plasma Desktop tries to restore the same session that was already restored in the previous session, which brings some unwanted apps that was used from long time, the sound level is restored correctly like it was before power cut but brightness is reset to 100%. It seems like when a session is restored it's not marked as consumed and should become eligible for deletion. The normal behavior that should be seen with sudden power cut is to start a new empty session instead of restoring a session state (already consumed) that was saved from long time. Operating System: Manjaro Linux KDE Plasma Version: 5.22.4 KDE Frameworks Version: 5.85.0 Qt Version: 5.15.2 Kernel Version: 5.13.12-1-MANJARO (64-bit) Graphics Platform: X11
Yes, it seems like the session is only saved on a clean shutdown, not an unexpected one, so session restoration cannot be used to recover your state for this use case. Since we can't detect when the session is about to get killed by a crash or a power cut, we would probably need to do something sad like set a timer every n minutes that would save the current session if anything about it has changed from the last-saved state.
Right, because the session wasn't saved because the system lost power before that could happen. Probably we would need to implement Bug 60894 to fix it. *** This bug has been marked as a duplicate of bug 60894 ***