Clean obsolete Extentions during client synchronization
Include the prepared cleanup of both client roots while preserving manifest-listed files and unrelated user state. Verified on Windows through FVM: full formatting and analysis, all 76 tests, production dry run, x64 build and DSA signature verification.
This commit is contained in:
@@ -169,7 +169,12 @@ void main() {
|
||||
addTearDown(() => root.delete(recursive: true));
|
||||
final service = GameInstallationService();
|
||||
final retained = ['MoonWell.exe', 'Data/common.MPQ', 'required.dll'];
|
||||
final obsolete = ['Data/old/patch.MPQ', 'WoW.exe', 'unused.DLL'];
|
||||
final obsolete = [
|
||||
'Data/old/patch.MPQ',
|
||||
'WoW.exe',
|
||||
'unused.DLL',
|
||||
'Extentions/bin/extension.dll',
|
||||
];
|
||||
for (final path in [
|
||||
...retained,
|
||||
...obsolete,
|
||||
@@ -217,7 +222,12 @@ void main() {
|
||||
contains(ClientSyncStage.removingStaleFiles),
|
||||
);
|
||||
expect(api.downloadedPaths, isEmpty);
|
||||
for (final path in [...obsolete, 'Data/old']) {
|
||||
for (final path in [
|
||||
...obsolete,
|
||||
'Data/old',
|
||||
'Extentions/bin',
|
||||
'Extentions',
|
||||
]) {
|
||||
expect(
|
||||
await FileSystemEntity.type(
|
||||
service.resolveClientPath(root.path, path),
|
||||
|
||||
@@ -77,6 +77,8 @@ void main() {
|
||||
'WoW/WoW.exe',
|
||||
'WoW/old.dll',
|
||||
'WoW/Data/old.MPQ',
|
||||
'Extentions/bin/extension.dll',
|
||||
'WoW/Extentions/old.txt',
|
||||
];
|
||||
final untouchedPaths = [
|
||||
'Cache/cache.bin',
|
||||
@@ -105,6 +107,9 @@ void main() {
|
||||
await Directory(
|
||||
service.resolveClientPath(rootDirectory.path, 'Data/unused/nested'),
|
||||
).create(recursive: true);
|
||||
await Directory(
|
||||
service.resolveClientPath(rootDirectory.path, 'Extentions/empty'),
|
||||
).create(recursive: true);
|
||||
final manifest = await _manifestForPaths(
|
||||
service,
|
||||
rootDirectory,
|
||||
@@ -129,6 +134,10 @@ void main() {
|
||||
'Data/empty',
|
||||
'Data/unused/nested',
|
||||
'Data/unused',
|
||||
'Extentions/bin',
|
||||
'Extentions/empty',
|
||||
'Extentions',
|
||||
'WoW/Extentions',
|
||||
]),
|
||||
);
|
||||
for (final path in snapshot.stalePaths) {
|
||||
|
||||
Reference in New Issue
Block a user