From 4d2aef637f0844956f52426bb21fcc642506fe9d Mon Sep 17 00:00:00 2001 From: Toutsu Date: Thu, 4 Jun 2026 08:13:10 +0300 Subject: [PATCH] fix(wizard): bind @PayloadJson parameter in UpsertAsync INSERT The UpsertAsync SQL used @Payload (without 'Json' suffix) but the WizardDraft POCO exposes the property as PayloadJson. Dapper.AOT requires parameter names to match property names, so the parameter went through unbinded and PostgreSQL rejected 'payload' as a column reference. Without integration tests this went unnoticed; the new WizardDraftRepositoryTests now exercise the path and surface it. --- .../Sessions/CreateSession/Wizard/WizardDraftRepository.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GmRelay.Shared/Features/Sessions/CreateSession/Wizard/WizardDraftRepository.cs b/src/GmRelay.Shared/Features/Sessions/CreateSession/Wizard/WizardDraftRepository.cs index 53aa086..155cd95 100644 --- a/src/GmRelay.Shared/Features/Sessions/CreateSession/Wizard/WizardDraftRepository.cs +++ b/src/GmRelay.Shared/Features/Sessions/CreateSession/Wizard/WizardDraftRepository.cs @@ -43,7 +43,7 @@ public sealed class WizardDraftRepository(NpgsqlDataSource dataSource) INSERT INTO wizard_drafts (id, chat_id, message_thread_id, owner_telegram_id, step, payload, draft_message_id, created_at, updated_at, expires_at) VALUES - (@Id, @ChatId, @MessageThreadId, @OwnerTelegramId, @Step, @Payload::jsonb, @DraftMessageId, @CreatedAt, @UpdatedAt, @ExpiresAt) + (@Id, @ChatId, @MessageThreadId, @OwnerTelegramId, @Step, @PayloadJson::jsonb, @DraftMessageId, @CreatedAt, @UpdatedAt, @ExpiresAt) ON CONFLICT (id) DO UPDATE SET step = EXCLUDED.step, payload = EXCLUDED.payload,