From 86fb7d7dba53eb44290d6355efa861cd900b3fbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=93=D0=BE=D0=BB=D0=B8=D0=BA=D0=BE=D0=B2=20Maximillian?= =?UTF-8?q?=20=D0=90=D0=BD=D1=82=D0=BE=D0=BD?= Date: Sat, 28 Nov 2026 15:46:03 +0300 Subject: [PATCH] fix(storage): lab6 read attachments after clearing staging --- backend/internal/storage/postgres/attachments.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/internal/storage/postgres/attachments.go b/backend/internal/storage/postgres/attachments.go index 8caf791..d0e9b62 100644 --- a/backend/internal/storage/postgres/attachments.go +++ b/backend/internal/storage/postgres/attachments.go @@ -72,7 +72,7 @@ func (r *AttachmentRepo) GetByID(ctx context.Context, id string) (*domain.Attach const q = ` SELECT id, chat_id, owner_id, filename, content_type, size_bytes, sha256, object_key, status, error_code, created_at, updated_at, - attempts, next_attempt_at, locked_until, pipeline_version, staging_key + attempts, next_attempt_at, locked_until, pipeline_version, COALESCE(staging_key, '') FROM attachments WHERE id = $1::uuid ` @@ -280,7 +280,7 @@ func (r *AttachmentRepo) ListExpiredLeases(ctx context.Context, limit int) ([]do const q = ` SELECT id, chat_id, owner_id, filename, content_type, size_bytes, sha256, object_key, status, error_code, created_at, updated_at, - attempts, next_attempt_at, locked_until, pipeline_version, staging_key + attempts, next_attempt_at, locked_until, pipeline_version, COALESCE(staging_key, '') FROM attachments WHERE status = 'processing' AND locked_until < now() ORDER BY locked_until