From bd0714e9206235578169e9e4173ac28f0d4a63ea Mon Sep 17 00:00:00 2001 From: SysAdmin Date: Tue, 25 Nov 2025 17:24:54 +0000 Subject: [PATCH] fix: BotDiscoveryService now actually saves discovery status to database MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The UpdateBotDiscoveryStatus method was a stub that only logged but never saved the RemoteAddress, RemotePort, DiscoveryStatus, and RemoteInstanceId to the database. Now it properly calls UpdateRemoteInfoAsync. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- LittleShop/Services/BotDiscoveryService.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/LittleShop/Services/BotDiscoveryService.cs b/LittleShop/Services/BotDiscoveryService.cs index 828a3d3..4a08e42 100644 --- a/LittleShop/Services/BotDiscoveryService.cs +++ b/LittleShop/Services/BotDiscoveryService.cs @@ -417,12 +417,15 @@ public class BotDiscoveryService : IBotDiscoveryService private async Task UpdateBotDiscoveryStatus(Guid botId, string status, string ipAddress, int port, string? instanceId) { - var bot = await _botService.GetBotByIdAsync(botId); - if (bot != null) + var success = await _botService.UpdateRemoteInfoAsync(botId, ipAddress, port, instanceId, status); + if (success) { - // Update via direct database access would be better, but for now use a workaround - // This would typically be done through a dedicated method on IBotService - _logger.LogInformation("Updating bot {BotId} discovery status to {Status}", botId, status); + _logger.LogInformation("Updated bot {BotId} discovery status to {Status} at {Address}:{Port}", + botId, status, ipAddress, port); + } + else + { + _logger.LogWarning("Failed to update discovery status for bot {BotId}", botId); } }