diff --git a/changes/440.fixed.md b/changes/440.fixed.md new file mode 100644 index 000000000..693f0032b --- /dev/null +++ b/changes/440.fixed.md @@ -0,0 +1,4 @@ +**Backups from a test, demo or second data folder no longer default to your real Documents backups.** Only the +default data folder (`~/.sentient`) backs up to Documents now; any other `SENTIENT_HOME` keeps its backups in its own +`backups` folder unless you pick a folder. If such a data folder already had backups in Documents, they stay there; pick +that folder to see them again. diff --git a/desktop/src/features/settings/sections/Backups.tsx b/desktop/src/features/settings/sections/Backups.tsx index eb4450173..4ef16ed71 100644 --- a/desktop/src/features/settings/sections/Backups.tsx +++ b/desktop/src/features/settings/sections/Backups.tsx @@ -189,7 +189,9 @@ export function BackupsSection({ query }: SectionProps) { {customFolder ? 'The folder you picked.' : data.folder_in_home - ? "Inside Sentient's data folder, because your Documents folder can't be used. Pick a folder elsewhere so a backup survives losing it." + ? data.home_is_default + ? "Inside Sentient's data folder, because your Documents folder can't be used. Pick a folder elsewhere so a backup survives losing it." + : 'Backups for this data folder stay inside it. Pick a folder elsewhere so a backup survives losing it.' : 'In your Documents folder, apart from your data, so a backup survives losing it.'} diff --git a/desktop/src/lib/types.ts b/desktop/src/lib/types.ts index c164fc29d..1268a0ddd 100644 --- a/desktop/src/lib/types.ts +++ b/desktop/src/lib/types.ts @@ -3227,6 +3227,8 @@ export interface BackupOverview { home: string /** The backup folder is inside the data folder (so a backup would not survive losing it). */ folder_in_home: boolean + /** The data folder is the default `~/.sentient`; any other one keeps its backups inside itself. */ + home_is_default: boolean /** The sync service the backup folder is inside (its backups are copied to the cloud too). */ folder_cloud: 'OneDrive' | 'Dropbox' | 'Google Drive' | 'iCloud' | null backups: BackupEntry[] diff --git a/docs/API.md b/docs/API.md index 81bb8c518..25bdca10e 100644 --- a/docs/API.md +++ b/docs/API.md @@ -3605,7 +3605,8 @@ survives losing it: on Windows the Known Folder API's Documents (`SHGetKnownFold folder redirected to OneDrive is used), else `~/Documents`; `~/Documents` on macOS; on Linux `XDG_DOCUMENTS_DIR` when set, else `~/Documents` (`SENTIENT_DOCUMENTS_DIR` overrides it, and tests always set it). When Documents is missing or can't be written to, -`/backups`. A backup holds the devices certificate (`tls/`), so it should be kept somewhere private. +`/backups`, and always `/backups` for a data folder other than the default `~/.sentient` +(`home_is_default` in the overview), so a test or demo home never mixes its backups with the real ones. A backup holds the devices certificate (`tls/`), so it should be kept somewhere private. `folder_cloud` names the sync service the folder is inside, from the `OneDrive`, `OneDriveConsumer` and `OneDriveCommercial` environment variables and the path (`OneDrive...`, `Dropbox...`, `Google Drive`, `My Drive`, `GoogleDrive-...`, `iCloud Drive`, `Mobile Documents`, `com~apple~CloudDocs`); Settings then says the backups are @@ -3656,7 +3657,7 @@ back; if even that fails, it stays in `/backups/restore-old-