Session backups not working
-
Hi
A Windows update just restarted my PC and when NPP 8.3.3 opened it didn’t restore my previous session.
I have Settings > Backup > Remember current session ticked and I haven’t changed anything recently.
I opened a few files, restarted NPP and it has remembered them. Also there is a session.xml file in the appdata folder so it looks as if that is working again now, but I’ve no idea why it failed after the restart.Then I saw that “Enable session snapshot and periodic backup” wasn’t enabled, and I’m sure that I had enabled this feature before. The backup path contains a Dropbox backup subfolder but it does not appear to be editable. I then enabled the periodic backup but no file appears in the Dropbox folder.
My cloud settings location is set to Dropbox and config.xml is being stored there fine.Any ideas what has happened?
-
“Session snapshot and periodic backups” only backup files that are edited but not yet saved. So just turning on that option isn’t enough; you have to have an edited-and-not-saved file to be able to see the backup file created.
As to why it didn’t save your session – maybe at the time the Windows restart occurred, Windows discsonnected from Dropbox before closing Notepad++, so then when it wrote the session file, it was out of sync with Dropbox, and the Dropbox app decided to overwrite your local copy with the last version that was on the server. Or something else similar. It’s hard to deterine what actually happened without a repeatable way of causing the same symptoms to occur, and we cannot do that for you.
-
Tx for the info. “Remember current session” option has always worked, this is the first time it hasn’t so it seems odd that there was some timing issue this time with Dropbox. Also the option doesn’t even mention Dropbox.
Also I just tried editing a file, and changing the periodic backup to 10sec and it hasn’t saved anything in Dropbox. I’d have expected at least a session-backup-time-date-stamp.xml file somewhere.
I did find some old backed up text files in a subfolder “session backup” but they were from 2020!It seems something is def wrong.
I unticked the cloud option, restarted NPP and it reloaded my last session OK but it is no longer in dark mode and other settings are different, so it looks like it doesn’t save the active config locally. :-(
-
Also the option doesn’t even mention Dropbox.
That’s because the backup option isn’t influenced by Dropbox (though it is influenced by the cloud-mode setting). I was suggesting that due to an error in Windows and/or Dropbox and/or the exact sequence of events which Notepad++ cannot control, that maybe Dropbox was inaccessible at the time that Notepad++ tried to write your session file to the cloud folder in that one rare circumstance (not trying to say that it will never write your session file with cloud settings enabled, because that’s verifiably false.)
It seems something is def wrong.
Not for me. It works exactly as I expect:
-
set the cloud to
c:\usr\local\apps\npp\cloud
-
restart Notepad++ so that it is actually using the new configuration
-
add some text to a new file
-
confirm that the backup is set to
c:\usr\local\apps\npp\cloud\backup
-
look at Windows explorer and see that the
c:\usr\local\apps\npp\cloud\backup
contains the backup for that unsaved file
-
open
change.log
in Notepad++, add a space character, wait 7 sec, seechange.log@#####
appear in the...\cloud\backup
folder.
For me, session snapshot and periodic backup correctly saves backups of edited-but-not-saved files into the folder defined by the cloud settings and backup settings. So I don’t see a bug in the implementation.
unticked the cloud option, restarted NPP and it reloaded my last session OK but it is no longer in dark mode and other settings are different,
That’s because unticked, the settings (including Dark Mode) are stored in
%AppData%\Notepad++
(or in your portable folder if you are portable); and toggling that checkmark off will not copy the settings from the cloud folder to the%AppData%\Notepad++
folder. If you want to replicate your cloud settings to your %AppData\Notepad++` configuration), then copy the config files before re-starting Notepad++. -
-
@peterjones Tx for the illustrations. Well all these options appear to be working now. I guess something must have been broken which was fixed when I toggled the Settings on cloud storage option off and on.
But I have to say that the notion of a “backup” function deleting files from a backup folder is crazy. It seems what this feature actually does is temporarily store remote copies of unsaved files. I’m sure that may be useful in some cases (not sure what), but it is not a backup in any conventional sense of the word.
Also conflating it with session snapshot/backup unnecessarily muddies the waters, and I’m not even sure it stores that session snapshot file remotely. I don’t see any older session backup files either.
Ah well at least the function is working now but it really needs renaming to reflect its functionality and the intended use case documenting.
As for the Settings on Cloud vs local option, relying on the user to copy the config file over oneself is completely unexpected - the manual is misleading also “If you enable the Cloud settings, some configuration files will go in the defined directory (including contextMenu.xml, shortcuts.xml, userDefineLang.xml, langs.xml, stylers.xml, and config.xml”.
The app really should be saving the active config in whichever location is chosen.
-
@mr-brunes said in Session backups not working:
But I have to say that the notion of a “backup” function deleting files from a backup folder is crazy. It seems what this feature actually does is temporarily store remote copies of unsaved files. I’m sure that may be useful in some cases (not sure what), but it is not a backup in any conventional sense of the word.
Please read the FAQ and the npp-user-manual.org descriptions of those features. The “session snapshot and periodic backup” is only intended as a temporary backup of unsaved changes. It is a different feature from a true backup-on-save (same preferences dialog) or a more fully-featured automatic backup like the AutoSave plugin.
Many users find it highly useful (it allows Windows to reboot without them having to save their files first), though I find it more dangerous than useful (because it encourages people to not save).
If you think it needs renaming, you can put in a feature request (see this FAQ), but I doubt it will be changed, because it’s got a lot of history behind the name, and I bet the developers will argue that it is backing up the unsaved changes in the active files. But the worst that can happen is that they will disagree with your feature request and close it, or leave it in ignored limbo for eternity.
As for the Settings on Cloud vs local option, relying on the user to copy the config file over oneself is completely unexpected
I always assume that settings which change where an application reads configuration files from will not take effect until after I restart the application. Besides, it would have the opposite effect from what other users might want: I can see a use-case where a person wants Dark Mode set up when running from the cloud, but Light Mode when running from AppData, to help them know which config-file location they are in (or for some other pair of settings than Dark Mode) – and your suggestion that Notepad++ arbitrarily decide to overwrite the configuration file in the other location would make that use case impossible. So two completely reasonable desires at 100% conflict with each other… and no way for the developer to keep everyone happy.
BTW: if you have feature requests for the application , read the FAQ, because we cannot make any such changes from the Community Forum.
On the other hand, since I am the primary maintainer of the user manual, this statement is worrisome to me:
- the manual is misleading also “If you enable the Cloud settings, some configuration files will go in the defined directory (including contextMenu.xml, shortcuts.xml, userDefineLang.xml, langs.xml, stylers.xml, and config.xml”.
How is it misleading? It tells you exactly which config files do end up in the cloud folder. How does that not explain the behavior of the application as designed?
-
@mr-brunes said in Session backups not working:
and the intended use case documenting.
How is the FAQ in this forum, plus the huge number of notes in the backup section of the user manual describing exactly what the “session snapshot and periodic backup”, not sufficient “use case documenting”?