fix(health): acked SendAsync transport — report-loss counter restore is live, not dead code

This commit is contained in:
Joseph Doherty
2026-07-08 16:12:48 -04:00
parent 17af376a8e
commit 6300d6d399
5 changed files with 142 additions and 16 deletions
@@ -13,7 +13,11 @@ public class HealthReportSenderTests
private class FakeTransport : IHealthReportTransport
{
public List<SiteHealthReport> SentReports { get; } = [];
public void Send(SiteHealthReport report) => SentReports.Add(report);
public Task SendAsync(SiteHealthReport report, CancellationToken cancellationToken)
{
SentReports.Add(report);
return Task.CompletedTask;
}
}
private class FakeSiteIdentityProvider : ISiteIdentityProvider
@@ -387,7 +391,7 @@ public class HealthReportSenderTests
private int _callCount;
public List<SiteHealthReport> SentReports { get; } = [];
public void Send(SiteHealthReport report)
public Task SendAsync(SiteHealthReport report, CancellationToken cancellationToken)
{
var n = Interlocked.Increment(ref _callCount);
if (n == 1)
@@ -395,6 +399,7 @@ public class HealthReportSenderTests
throw new InvalidOperationException("transport temporarily unavailable");
}
SentReports.Add(report);
return Task.CompletedTask;
}
}