Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Session.xml emptied with Windows upgrade while PC left in Sleep mode with Notepad++ open #12389

Closed
mpopejoy-dxc opened this issue Oct 24, 2022 · 3 comments

Comments

@mpopejoy-dxc
Copy link

Description of the Issue

"Lost" my session during Windows updates that occurred when I left my PC in Sleep mode with Notepad++ (and other apps) open.

Steps to Reproduce the Issue

  1. Notepad++ open with dozens of open files (other apps also left open)
  2. Windows -> Power -> Power -> Sleep
  3. (me -> bed -> sleep)
  4. (some hours later) Windows installed 2022-10 Cumulative Update for Windows 10 Version 21H2 for x64-based Systems (KB5018410)
  5. Powered on/woke up PC

Expected Behavior

(Before knowing that a Windows update had occurred, I expected...) all apps and windows to be open and on the monitor (of 3) that I left them on - including Notepad++ with all the files I had open.
(Since a Windows update did occur, I'd expect...) have to log in to a fresh Windows session and potentially get a complaint from some Office apps that I hadn't saved or shut down properly. Upon opening Notepad++, I'd expect all the files I had open to be open.

Actual Behavior

Windows re-logged me in and reopened all the windows and apps I had opened (Firefox - 2 windows, multiple tabs in main one, Chrome, Outlook - 3 folders and an open popped-out message, Teams, etc.)
Don't remember if Notepad++ was open with just new1 file or if it wasn't open so I launched it, then seeing only new1 file.

Debug Information

Notepad++ v8.4.6 (64-bit)
Build time : Sep 25 2022 - 19:51:39
Path : C:<maskedFolderName>\Notepad++\notepad++.exe
Command Line : "C:<maskedFolderName>\Notepad++\change.log"
Admin mode : OFF
Local Conf mode : ON
Cloud Config : C:\Users<maskedUsername>\Dropbox
OS Name : Windows 10 Enterprise (64-bit)
OS Version : 21H2
OS Build : 19044.2130
Current ANSI codepage : 1252
Plugins :
mimeTools (2.8)
NppConverter (4.4)
NppExport (0.4)

Note: one posting I found indicated that reinstalling N++, but not deinstalling, solved their issue. Even though I didn't expect it to help, I tried that. That was before capturing the debug info above.

I found nppLogNulContentCorruptionIssue.log in Cloud Config folder with timestamp of Windows upgrade so I know what time session.xml was overwritten with 193 bytes instead of the previous 374907. File attached.
nppLogNulContentCorruptionIssue.log

@xomx
Copy link
Contributor

xomx commented Oct 24, 2022

Thanks for the log and sorry for the session lost.
Probably the same as the #9850 .

@ArkadiuszMichalski
Copy link
Contributor

Duplicate of #9850.

donho pushed a commit that referenced this issue Oct 30, 2022
This fixes both the long standing problem with the emptying of the session.xml file by forced Windows Update restart/shutdown and some potential Notepad++ crashes caused by possible main Notepad++ window blocking at exit.

Two main changes to the original design:
- WM_QUERYENDSESSION is not used anymore for the tidy-up ops and it always quickly returns TRUE/FALSE to the system as it should.
- there is now a safe-guard flag for the session.xml saving at N++ exit, which prevents otherwise possible incorrect overwriting in case of multiple "endsession" messages.

Fix #9850, fix #12389, close #12388
@donho
Copy link
Member

donho commented Nov 1, 2022

Fix by 6000f3b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants