fix(notifications): SMS adapter short-circuits on first transient — kills duplicate amplification and bounds the dispatch sweep
Claude-Session: https://claude.ai/code/session_01MtdgwpEeCUn6cUA5f1LMPj
This commit is contained in:
+18
@@ -299,6 +299,24 @@ public class SmsNotificationDeliveryAdapterTests
|
||||
Assert.Equal(DeliveryResult.TransientFailure, outcome.Result);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task MidListTransient_ShortCircuits_RemainingRecipientsNotAttempted()
|
||||
{
|
||||
// Three recipients; the FIRST one comes back transient (500). Every recipient
|
||||
// accepted after a transient is a guaranteed duplicate on retry (the whole
|
||||
// notification re-sends), so the adapter must stop at the first transient
|
||||
// instead of attempting the remaining two.
|
||||
SetupList(phones: new[] { "+15551112222", "+15553334444", "+15555556666" });
|
||||
var handler = ScriptedHttpMessageHandler.ForStatuses(
|
||||
HttpStatusCode.InternalServerError, HttpStatusCode.Created, HttpStatusCode.Created);
|
||||
var adapter = CreateAdapter(handler);
|
||||
|
||||
var outcome = await adapter.DeliverAsync(MakeNotification());
|
||||
|
||||
Assert.Equal(DeliveryResult.TransientFailure, outcome.Result);
|
||||
Assert.Single(handler.Requests);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Deliver_ListNotFound_ReturnsPermanent()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user