Repository: files-community/Files
File: src/Files.App/Utils/Cloud/Detector/GoogleDriveCloudDetector.cs (C#)

Code before:
				App.AppModel.GoogleDrivePath = path;

#if DEBUG
				Debug.WriteLine("YIELD RETURNING from GoogleDriveCloudDetector#GetProviders (roots): ");
				Debug.WriteLine("name=" + $"Google Drive ({title}); path=" + path);
#endif

				yield return new CloudProvider(CloudProviders.GoogleDrive)
				{
					Name = $"Google Drive ({title})",
					SyncFolder = path,
				};
			}

			// Google virtual drive
			reader = cmdMedia.ExecuteReader();

			while (reader.Read())
			{
				string? path = reader["last_mount_point"]?.ToString();
				if (string.IsNullOrWhiteSpace(path))
					continue;

				if (!AddMyDriveToPathAndValidate(ref path))
				{ 
					_logger.LogWarning("Validation failed for " + path + " (media)");
					continue;
				}

				var folder = await StorageFolder.GetFolderFromPathAsync(path);
				string title = reader["name"]?.ToString() ?? folder.Name;

				App.AppModel.GoogleDrivePath = path;

				StorageFile? iconFile = await GetGoogleDriveIconFileAsync();

#if DEBUG
				Debug.WriteLine("YIELD RETURNING from GoogleDriveCloudDetector#GetProviders (media): ");
				Debug.WriteLine("name=" + title + "; path=" + path);
#endif

				yield return new CloudProvider(CloudProviders.GoogleDrive)
				{
					Name = title,
					SyncFolder = path,
					IconData = iconFile is not null ? await iconFile.ToByteArrayAsync() : null,
				};
			}

#if DEBUG
			await Inspect(database, "SELECT * FROM roots", "root_preferences db, roots table");

Review comment (bug):
```suggestion
					_logger.LogWarning($"Validation failed for {path} (media)");

```


Code after:
					SyncFolder = path,
				};
			}

			var iconFile = await GetGoogleDriveIconFileAsync();
			// Google virtual drive
			reader = cmdMedia.ExecuteReader();

			while (reader.Read())
			{
				string? path = reader["last_mount_point"]?.ToString();
				if (string.IsNullOrWhiteSpace(path))
					continue;

				if (!AddMyDriveToPathAndValidate(ref path))
					continue;

				var folder = await StorageFolder.GetFolderFromPathAsync(path);
				string title = reader["name"]?.ToString() ?? folder.Name;

				Debug.WriteLine("YIELD RETURNING from `GoogleDriveCloudDetector.GetProviders` (media): ");
				Debug.WriteLine($"Name: {title}; SyncFolder: {path}");

				yield return new CloudProvider(CloudProviders.GoogleDrive)
				{
					Name = title,
					SyncFolder = path,
					IconData = iconFile is not null ? await iconFile.ToByteArrayAsync() : null,
				};
			}

			await Inspect(database, "SELECT * FROM roots", "root_preferences db, roots table");
			await Inspect(database, "SELECT * FROM media", "root_preferences db, media table");
			await Inspect(database, "SELECT name FROM sqlite_master WHERE type = 'table' ORDER BY 1", "root_preferences db, all tables");

			var registryPath = App.AppModel.GoogleDrivePath;
			if (!AddMyDriveToPathAndValidate(ref registryPath))
				yield break;
			yield return new CloudProvider(CloudProviders.GoogleDrive)
			{
				Name = "Google Drive",
				SyncFolder = registryPath,
				IconData = iconFile is not null ? await iconFile.ToByteArrayAsync() : null
			};
		}

		private static async Task Inspect(SqliteConnection database, string sqlCommand, string targetDescription)
		{
			await using var cmdTablesAll = new SqliteCommand(sqlCommand, database);
			var reader = await cmdTablesAll.ExecuteReaderAsync();
			var colNamesList = Enumerable.Range(0, reader.FieldCount).Select(i => reader.GetName(i)).ToList();