From 615fab4a10d2583f71c3c38e98c907f398d3f5bf Mon Sep 17 00:00:00 2001 From: Harun Baris Bulut Date: Mon, 12 Oct 2026 17:40:32 +0300 Subject: [PATCH] fix: drop unnecessary conversion in device notifications (lint, v0.14.1) Co-Authored-By: Claude Sonnet 5.5 --- docs/progress.md | 2 +- internal/api/handlers_notifications.go | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/progress.md b/docs/progress.md index 246ff9d..5c852fb 100644 --- a/docs/progress.md +++ b/docs/progress.md @@ -167,7 +167,7 @@ Suppression: a pool host that goes down suppresses its VMs' incidents and the ch Verified by `TestPool`, `TestPoolFollowsMaster`, `TestPoolFailures` (fake pool), `TestDiscoveredDevices` (engine, devices, incidents, metrics, limits, retention) and `TestDiscoveredHostSuppression`. -### v0.14.0 — notification catalog and device notifications +### v0.14.1 — notification catalog and device notifications (v0.14.0 failed lint) `GET /v1/notification-catalog` and `GET /v1/devices/{device_id}/notifications` ([F06](features/F06-notifications.md#notification-catalog-and-device-view)): a customer sees which routes take a device's incidents, whether their webhooks work, whether the next incident would fire (`would_fire` with a `reason`), and the deliveries about the device with their payloads. Migration `00025` links deliveries to devices. Verified by `TestDeviceNotifications`. diff --git a/internal/api/handlers_notifications.go b/internal/api/handlers_notifications.go index 6d19a50..e95c74a 100644 --- a/internal/api/handlers_notifications.go +++ b/internal/api/handlers_notifications.go @@ -2,7 +2,6 @@ package api import ( "context" - "encoding/json" "github.com/jackc/pgx/v5" @@ -88,7 +87,7 @@ func (s *Server) ListDeviceNotifications(ctx context.Context, req gen.ListDevice "route_id": d.RouteID, "route_name": d.RouteName, "route_external": d.RouteExternal, "endpoint_id": d.EndpointID, "endpoint_name": d.EndpointName, "endpoint_external": d.EndpointExt, "status": d.Status, "attempts": d.Attempts, "last_status_code": d.LastStatusCode, "last_error": d.LastError, "last_attempt_at": d.LastAttemptAt, - "delivered_at": d.DeliveredAt, "created_at": d.CreatedAt, "payload": json.RawMessage(d.Payload), + "delivered_at": d.DeliveredAt, "created_at": d.CreatedAt, "payload": d.Payload, } } res, err := via[gen.DeviceNotifications](out)