From c90942741d3ee9a26f65f71abd19413c3ed960e5 Mon Sep 17 00:00:00 2001 From: Tyrie Vella Date: Mon, 12 Jan 2026 15:35:03 -0800 Subject: [PATCH] Log hydration calculation errors to telemetry --- GVFS/GVFS.Common/GitStatusCache.cs | 3 ++- .../HealthCalculator/EnlistmentHydrationSummary.cs | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/GVFS/GVFS.Common/GitStatusCache.cs b/GVFS/GVFS.Common/GitStatusCache.cs index 717e7aebc..bce8f444f 100644 --- a/GVFS/GVFS.Common/GitStatusCache.cs +++ b/GVFS/GVFS.Common/GitStatusCache.cs @@ -372,9 +372,10 @@ private void UpdateHydrationSummary() } else { + metadata["Exception"] = hydrationSummary.Error?.ToString(); this.context.Tracer.RelatedWarning( metadata, - $"{nameof(GitStatusCache)}{nameof(RebuildStatusCacheIfNeeded)}: hydration summary could not be calculdated.", + $"{nameof(GitStatusCache)}{nameof(RebuildStatusCacheIfNeeded)}: hydration summary could not be calculated.", Keywords.Telemetry); } } diff --git a/GVFS/GVFS.Common/HealthCalculator/EnlistmentHydrationSummary.cs b/GVFS/GVFS.Common/HealthCalculator/EnlistmentHydrationSummary.cs index 02a32c2f5..6762e2665 100644 --- a/GVFS/GVFS.Common/HealthCalculator/EnlistmentHydrationSummary.cs +++ b/GVFS/GVFS.Common/HealthCalculator/EnlistmentHydrationSummary.cs @@ -12,6 +12,8 @@ public class EnlistmentHydrationSummary public int TotalFileCount { get; private set; } public int HydratedFolderCount { get; private set; } public int TotalFolderCount { get; private set; } + public Exception Error { get; private set; } = null; + public bool IsValid { @@ -67,7 +69,7 @@ public static EnlistmentHydrationSummary CreateSummary( TotalFolderCount = totalFolderCount, }; } - catch + catch (Exception e) { return new EnlistmentHydrationSummary() { @@ -75,6 +77,7 @@ public static EnlistmentHydrationSummary CreateSummary( HydratedFolderCount = -1, TotalFileCount = -1, TotalFolderCount = -1, + Error = e, }; } }