fix(sitecalls): Parked is re-openable end to end — operator Retry/Discard reach the site tracking row and central SiteCalls (SCA-1, WP4 task 4.9)

This commit is contained in:
Joseph Doherty
2026-12-03 10:18:43 -05:00
parent 4070f7efca
commit 5c67559a25
12 changed files with 578 additions and 15 deletions
@@ -1274,6 +1274,17 @@ public class StoreAndForwardService
RaiseActivity("Retry", captured.Category,
$"Parked message {messageId} moved back to queue");
// SCA-1: a re-queued cached call leaves Parked end to end — the observer re-opens the
// site tracking row and emits telemetry so central's SiteCalls row follows. Without it
// the row stayed Parked forever (later attempts were no-ops on a terminal row).
await PostObserverNotification(
captured,
CachedCallAttemptOutcome.OperatorRetried,
lastError: null,
httpStatus: null,
occurredAtUtc: DateTime.UtcNow,
durationMs: null);
return true;
}
@@ -1299,6 +1310,19 @@ public class StoreAndForwardService
{
RaiseActivity("Discard", message?.Category ?? StoreAndForwardCategory.ExternalSystem,
$"Parked message {messageId} discarded");
// SCA-1: record the discard on the tracking row (Parked → Discarded) and emit
// telemetry, so Tracking.Status and central's SiteCalls row stop reporting Parked.
if (message is not null)
{
await PostObserverNotification(
message,
CachedCallAttemptOutcome.OperatorDiscarded,
lastError: "Discarded by operator",
httpStatus: null,
occurredAtUtc: DateTime.UtcNow,
durationMs: null);
}
}
return success;
}