From 11ba3cdac4d0d4d4130b29aa9b9d9e8cad7de8a3 Mon Sep 17 00:00:00 2001 From: TekH Date: Mon, 2 Nov 2026 10:11:27 +0100 Subject: [PATCH] refactor(client)!: return Task from EmailSender.Send Await ISendingEmailPublisher.EnqueueAsync so publish failures surface to the caller instead of being lost in a fire-and-forget call. BREAKING CHANGE: EmailSender.Send now returns Task and must be awaited. Synchronous callers that relied on exceptions being thrown directly from Send will no longer observe them. --- .../DigitalData.MessagingService.Client/EmailSender.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/presentation/DigitalData.MessagingService.Client/EmailSender.cs b/src/presentation/DigitalData.MessagingService.Client/EmailSender.cs index 2e4b0b4..eaa71d5 100644 --- a/src/presentation/DigitalData.MessagingService.Client/EmailSender.cs +++ b/src/presentation/DigitalData.MessagingService.Client/EmailSender.cs @@ -120,13 +120,13 @@ public static class EmailSender /// Ensure that any unhandled exceptions from the async operation are handled /// at the publisher level. /// - public static void Send(EmailContext email) + public static async Task Send(EmailContext email) { if(!IsConnected) throw new InvalidOperationException("Messaging service is not connected. Call ConnectRabbitMq first."); var publisher = LazyProvider.Value.GetRequiredService(); - publisher.EnqueueAsync(new SendingEmailEvent() + await publisher.EnqueueAsync(new SendingEmailEvent() { Id = Guid.NewGuid(), Mail = email,