From 0f6a183ed4d267f704b647f268325e2402070f20 Mon Sep 17 00:00:00 2001 From: Haiping Chen <101423@smsassist.com> Date: Wed, 28 Feb 2024 20:41:21 -0600 Subject: [PATCH] Fix Pop agent bug. --- .../BotSharp.Core/Routing/Functions/RouteToAgentFn.cs | 3 --- src/Infrastructure/BotSharp.Core/Routing/RoutingContext.cs | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Infrastructure/BotSharp.Core/Routing/Functions/RouteToAgentFn.cs b/src/Infrastructure/BotSharp.Core/Routing/Functions/RouteToAgentFn.cs index bba32ff8..55bcdf82 100644 --- a/src/Infrastructure/BotSharp.Core/Routing/Functions/RouteToAgentFn.cs +++ b/src/Infrastructure/BotSharp.Core/Routing/Functions/RouteToAgentFn.cs @@ -1,7 +1,4 @@ using BotSharp.Abstraction.Functions; -using BotSharp.Abstraction.Repositories; -using BotSharp.Abstraction.Repositories.Filters; -using BotSharp.Abstraction.Routing; using BotSharp.Abstraction.Routing.Models; using System.Drawing; diff --git a/src/Infrastructure/BotSharp.Core/Routing/RoutingContext.cs b/src/Infrastructure/BotSharp.Core/Routing/RoutingContext.cs index d12adfa2..2666daff 100644 --- a/src/Infrastructure/BotSharp.Core/Routing/RoutingContext.cs +++ b/src/Infrastructure/BotSharp.Core/Routing/RoutingContext.cs @@ -80,9 +80,10 @@ public class RoutingContext : IRoutingContext } var agentId = _stack.Pop(); + var currentAgentId = GetCurrentAgentId(); HookEmitter.Emit(_services, async hook => - await hook.OnAgentDequeued(agentId, _stack.Peek(), reason: reason) + await hook.OnAgentDequeued(agentId, currentAgentId, reason: reason) ).Wait(); }