From 07afcf3aa2fa863908d461b571e7695486608f32 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Sat, 29 Nov 2025 01:12:03 +0100 Subject: [PATCH] Add logging for unexpected BodyQuery and IsReturnedNoData Improve observability by adding a warning log when `request.BodyQuery` is not null but `request.IsReturnedNoData.BodyQuery` is false. The log message highlights potential issues, such as skipped `BodyQueryBehavior` execution or missing control steps, and includes `ProfileId` and `ActionId` for better debugging context. --- .../RecActions/Commands/InvokeRecActionCommand.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/ReC.Application/RecActions/Commands/InvokeRecActionCommand.cs b/src/ReC.Application/RecActions/Commands/InvokeRecActionCommand.cs index 7f341cf..135700e 100644 --- a/src/ReC.Application/RecActions/Commands/InvokeRecActionCommand.cs +++ b/src/ReC.Application/RecActions/Commands/InvokeRecActionCommand.cs @@ -45,6 +45,17 @@ public class InvokeRecActionCommandHandler( using var reqBody = new StringContent(request.Body); httpReq.Content = reqBody; } + else if(request.BodyQuery is not null && !request.IsReturnedNoData.BodyQuery) + { + logger?.LogWarning( + "Although BodyQuery returns null, the IsReturnedNoData variable has not been set to TRUE. " + + "This indicates that BodyQueryBehavior has not been executed or that the relevant control step has been skipped. " + + "The relevant behavior must be verified to ensure that the process does not produce unexpected conditions. " + + "ProfileId: {ProfileId}, ActionId: {ActionId}", + request.ProfileId, + request.ActionId + ); + } using var response = await http.SendAsync(httpReq, cancel); var body = await response.Content.ReadAsStringAsync(cancel);