diff --git a/src/Infrastructure/BotSharp.Abstraction/Infrastructures/Events/IEventPublisher.cs b/src/Infrastructure/BotSharp.Abstraction/Infrastructures/Events/IEventPublisher.cs
index f2276c13..31a708bc 100644
--- a/src/Infrastructure/BotSharp.Abstraction/Infrastructures/Events/IEventPublisher.cs
+++ b/src/Infrastructure/BotSharp.Abstraction/Infrastructures/Events/IEventPublisher.cs
@@ -10,7 +10,7 @@ public interface IEventPublisher
///
Task BroadcastAsync(string channel, string message);
- Task PublishAsync(string channel, string message, EventPriority? priority = null);
+ Task PublishAsync(string channel, string message, EventPriority? priority = null);
Task ReDispatchAsync(string channel, int count = 10, string order = "asc");
diff --git a/src/Infrastructure/BotSharp.Abstraction/Utilities/Pagination.cs b/src/Infrastructure/BotSharp.Abstraction/Utilities/Pagination.cs
index 8e5c7f23..4d21013b 100644
--- a/src/Infrastructure/BotSharp.Abstraction/Utilities/Pagination.cs
+++ b/src/Infrastructure/BotSharp.Abstraction/Utilities/Pagination.cs
@@ -1,7 +1,9 @@
using BotSharp.Abstraction.Infrastructures;
+using System.Diagnostics;
namespace BotSharp.Abstraction.Utilities;
+[DebuggerStepThrough]
public class Pagination : ICacheKey
{
private int _page;
diff --git a/src/Infrastructure/BotSharp.Core/Infrastructures/Events/RedisPublisher.cs b/src/Infrastructure/BotSharp.Core/Infrastructures/Events/RedisPublisher.cs
index 435451d4..32889f4f 100644
--- a/src/Infrastructure/BotSharp.Core/Infrastructures/Events/RedisPublisher.cs
+++ b/src/Infrastructure/BotSharp.Core/Infrastructures/Events/RedisPublisher.cs
@@ -21,7 +21,7 @@ public class RedisPublisher : IEventPublisher
await _subscriber.PublishAsync(channel, message);
}
- public async Task PublishAsync(string channel, string message, EventPriority? priority = null)
+ public async Task PublishAsync(string channel, string message, EventPriority? priority = null)
{
var db = _redis.GetDatabase();
@@ -34,7 +34,7 @@ public class RedisPublisher : IEventPublisher
if (CheckMessageExists(db, channel, "message", message))
{
_logger.LogError($"The message already exists {channel} {message}");
- return;
+ return null;
}
// Add a message to the stream, keeping only the latest 1 million messages
@@ -46,6 +46,8 @@ public class RedisPublisher : IEventPublisher
maxLength: 1000 * 10000);
_logger.LogInformation($"Published message {channel} {message} ({messageId})");
+
+ return messageId;
}
private bool CheckMessageExists(IDatabase db, string channel, string fieldName, string desiredValue)