Added backups of all data, restorable on another computer (#1008)

Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
This commit is contained in:
j-erlerandThorsten Sommer authored and GitHub committed 2026-10-15 16:42:02 +02:00
1 parent ab45580473
commit 936043319c
144 files changed
+10417 -424

No files matched your search

@@ -4,9 +4,12 @@
- Introduced: 2026-07-09
- Remove after: when Microsoft fixes dotnet/runtime#27620 and dotnet/runtime#41914
- Code references:
- `app/MindWork AI Studio/Tools/ZipEntryNames.cs` (`Normalize`, which treats backslashes as separators)
- `app/MindWork AI Studio/Tools/PluginSystem/PluginArchive.cs`
- `app/MindWork AI Studio/Tools/PluginSystem/PluginFactory.Download.cs`
- `app/MindWork AI Studio/Tools/Services/AssistantPluginInstallService.cs`
- `app/MindWork AI Studio/Tools/Services/PluginInstallService.Import.cs`
- `app/MindWork AI Studio/Tools/ChatArchive/ChatArchiveImporter.cs`
- `app/Tests/Tools/ZipEntryNamesTests.cs`
## User Impact
@@ -18,7 +21,7 @@ The same applies to plugin archives that users import from their disk. Archives
## Compatibility Behavior
AI Studio manually extracts enterprise configuration plugin archives and plugin archives imported by users. During extraction, entry names are normalized so both `/` and `\` are treated as archive path separators.
AI Studio manually extracts enterprise configuration plugin archives and plugin archives imported by users. During extraction, entry names are normalized so both `/` and `\` are treated as archive path separators. The same normalization in `ZipEntryNames` serves adding the chats of a backup, which AI Studio always writes with forward slashes.
The extraction still preserves the archive structure and validates each entry before writing it to disk. Rooted paths, drive-qualified paths, and parent-directory traversal paths are rejected.
@@ -28,4 +31,5 @@ This works around the behavior described in dotnet/runtime#27620. A related upst
- Confirm supported .NET runtimes and administrator packaging guidance no longer require accepting backslashes in enterprise ZIP entry names.
- Replace `PluginArchive.Extract(...)` with `ZipFile.ExtractToDirectory(...)`.
- Stop treating `\` as a separator in `ZipEntryNames.Normalize`, and drop the backslash cases from `ZipEntryNamesTests`. Keep the checks against rooted, drive-qualified, and `..` names: they protect every extraction, not just this shim.
- Update this document's status to `Removed`.
@@ -0,0 +1,33 @@
# Relative Data Paths
- Status: Active
- Introduced: 2026-10-14
- Remove after: 2027-04-14
- Code references:
- `app/MindWork AI Studio/Tools/Services/RelativeDataPathsMigrationService.cs`
- `app/MindWork AI Studio/Tools/WorkspaceBehaviour.RelativeDataPaths.cs`
- `app/MindWork AI Studio/Settings/DataModel/Data.cs` (`StoredDataPathsAreRelative`)
- `app/MindWork AI Studio/Program.cs` (registration of the service)
- `app/Tests/Tools/RelativeDataPathsMigrationTests.cs`
## User Impact
Up to v26.9.1, AI Studio stored the paths of its own files below the data directory as absolute paths: the transcripts of a chat in its `thread.json`, and the copies of the tokenizers in the settings. From v26.10.1 on, it stores them relative to the data directory, so that a backup of the data directory works on another computer, under another user name, or on another OS.
AI Studio reads an absolute path as it is, so a chat stored by v26.9.1 keeps working on the same computer without this shim. It stores the path relative the next time it stores the chat. A chat which is never stored again, though, would keep its absolute paths, and a backup would bring them to a computer where they lead nowhere.
## Compatibility Behavior
`RelativeDataPathsMigrationService` runs once after the start. It reads and writes every chat once more, within one hold of the chat's lock, so that nothing AI Studio stores meanwhile gets lost, and it keeps the time of the chat's last change. Then it stores the settings and marks the work as done in `StoredDataPathsAreRelative`. When a chat is busy for too long or cannot be written, the flag stays unset, and the next start tries again.
A downgrade to v26.9.1 does not understand relative paths: it no longer finds the transcripts of the chats nor the tokenizers which were copied into the data directory.
## Removal Checklist
- Remove `RelativeDataPathsMigrationService` and its registration in `Program.cs`.
- Remove `WorkspaceBehaviour.RelativeDataPaths.cs`. When no other partial part of `WorkspaceBehaviour` is left, make the class non-partial again.
- Remove `Data.StoredDataPathsAreRelative`. Settings which still hold the property read fine without it.
- Remove `app/Tests/Tools/RelativeDataPathsMigrationTests.cs`.
- Keep `DataDirectoryRelativePathConverter`: it is no shim. Reading an absolute path stays necessary for the files of the user.
- Update this document's status to `Removed`.
- No changelog entry is needed: a chat which was not stored since then still works on the same computer.