From 81a4ca3d4e8bfcf2ae6becdd5ee9ba585c009d0b Mon Sep 17 00:00:00 2001 From: James Lucas Date: Mon, 11 Nov 2024 13:03:48 -0600 Subject: [PATCH] Server: exit early if endpoints don't exist Ensure that we don't try to process a message for which endpoints no longer exist. Fixes #1511. --- server/svix-server/src/worker.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/svix-server/src/worker.rs b/server/svix-server/src/worker.rs index 1a4fc80c2..448436993 100644 --- a/server/svix-server/src/worker.rs +++ b/server/svix-server/src/worker.rs @@ -860,6 +860,11 @@ async fn process_queue_task_inner( }) .collect(); + if destinations.is_empty() { + tracing::debug!("No destinations for message. Returning"); + return Ok(()); + } + messagedestination::Entity::insert_many(destinations.clone()) .exec(db) .await?;