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:
@@ -630,11 +630,11 @@ Future<List<String>> _collectStalePaths(
|
||||
String relativePath(FileSystemEntity entity) =>
|
||||
normalizeClientPath(p.relative(entity.path, from: rootDirectory.path));
|
||||
|
||||
Future<void> collectData(Directory directory) async {
|
||||
Future<void> collectStaleDirectory(Directory directory) async {
|
||||
await for (final entity in directory.list(followLinks: false)) {
|
||||
final path = relativePath(entity);
|
||||
if (entity is Directory) {
|
||||
await collectData(entity);
|
||||
await collectStaleDirectory(entity);
|
||||
if (!manifestDirectories.contains(pathKey(path))) {
|
||||
stalePaths.add(path);
|
||||
}
|
||||
@@ -653,12 +653,20 @@ Future<List<String>> _collectStalePaths(
|
||||
final name = p.basename(entity.path).toLowerCase();
|
||||
if (entity is Directory) {
|
||||
if (name == 'data') {
|
||||
await collectData(entity);
|
||||
await collectStaleDirectory(entity);
|
||||
} else if (name == 'extentions') {
|
||||
await collectStaleDirectory(entity);
|
||||
if (!manifestDirectories.contains(pathKey(relativePath(entity)))) {
|
||||
stalePaths.add(relativePath(entity));
|
||||
}
|
||||
} else if (!nested && name == 'wow') {
|
||||
await collectClientRoot(entity, nested: true);
|
||||
}
|
||||
} else if ((name == 'wow.exe' || name.endsWith('.dll')) &&
|
||||
!manifestPaths.contains(pathKey(relativePath(entity)))) {
|
||||
} else if ((name == 'wow.exe' ||
|
||||
name.endsWith('.dll') ||
|
||||
(entity is Link && name == 'extentions')) &&
|
||||
!manifestPaths.contains(pathKey(relativePath(entity))) &&
|
||||
!manifestDirectories.contains(pathKey(relativePath(entity)))) {
|
||||
stalePaths.add(relativePath(entity));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user