From 693bca6cca5decf5a09fa8f6a556c0561a2f31c8 Mon Sep 17 00:00:00 2001 From: Shawn Jackson Date: Wed, 15 Jul 2026 20:58:50 -0700 Subject: [PATCH] RG-T125 Chatbot fix --- .../Resgrid.Model/Helpers/SerializerHelper.cs | 21 ++++++++++++++++++- .../Queue/ChatbotMessageQueueItem.cs | 1 + 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/Core/Resgrid.Model/Helpers/SerializerHelper.cs b/Core/Resgrid.Model/Helpers/SerializerHelper.cs index 50bb57043..022aa5900 100644 --- a/Core/Resgrid.Model/Helpers/SerializerHelper.cs +++ b/Core/Resgrid.Model/Helpers/SerializerHelper.cs @@ -1,5 +1,7 @@ -using ProtoBuf; +using ProtoBuf; +using Resgrid.Model.Events; using Resgrid.Model.Identity; +using Resgrid.Model.Queue; namespace Resgrid.Model.Helpers { @@ -7,6 +9,7 @@ public static class SerializerHelper { public static void WarmUpProtobufSerializer() { + // Core model types (also serialized into the cache). Serializer.PrepareSerializer(); Serializer.PrepareSerializer
(); Serializer.PrepareSerializer(); @@ -17,6 +20,22 @@ public static void WarmUpProtobufSerializer() Serializer.PrepareSerializer(); Serializer.PrepareSerializer(); Serializer.PrepareSerializer(); + + // Every payload type published to RabbitMQ (see RabbitOutboundQueueProvider). + // Preparing them here builds the protobuf contract at startup, so a type that is + // missing [ProtoContract] fails fast on boot instead of on the first enqueue. + Serializer.PrepareSerializer(); + Serializer.PrepareSerializer(); + Serializer.PrepareSerializer(); + Serializer.PrepareSerializer(); + Serializer.PrepareSerializer(); + Serializer.PrepareSerializer(); + Serializer.PrepareSerializer(); + Serializer.PrepareSerializer(); + Serializer.PrepareSerializer(); + Serializer.PrepareSerializer(); + Serializer.PrepareSerializer(); + Serializer.PrepareSerializer(); } } } diff --git a/Core/Resgrid.Model/Queue/ChatbotMessageQueueItem.cs b/Core/Resgrid.Model/Queue/ChatbotMessageQueueItem.cs index e94ee9602..36bfe92c2 100644 --- a/Core/Resgrid.Model/Queue/ChatbotMessageQueueItem.cs +++ b/Core/Resgrid.Model/Queue/ChatbotMessageQueueItem.cs @@ -8,6 +8,7 @@ namespace Resgrid.Model.Queue /// The worker resolves IChatbotIngressService, processes the message, and sends the reply /// back to via the SMS transport. /// + [ProtoContract] public class ChatbotMessageQueueItem { [ProtoMember(1)]