From 6f7d86bda66a342ecc20b7cbe241bcd3d5d2ead3 Mon Sep 17 00:00:00 2001 From: Dhruv Behl Date: Fri, 8 May 2026 19:41:56 +0530 Subject: [PATCH] fix: prevent catalog crash on duplicate business event channels Cloud-portal has duplicate business event channels in cached AsyncAPI documents, which caused a UNIQUE constraint crash on contract_messages that killed the entire catalog build (blocking REFRESH CATALOG FULL). Fix: INSERT OR IGNORE to tolerate duplicate rows defensively. --- mdl/catalog/builder_contract.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mdl/catalog/builder_contract.go b/mdl/catalog/builder_contract.go index f20cfae6..a66f8abc 100644 --- a/mdl/catalog/builder_contract.go +++ b/mdl/catalog/builder_contract.go @@ -138,7 +138,7 @@ func (b *Builder) buildContractMessages() error { } stmt, err := b.tx.Prepare(` - INSERT INTO contract_messages (Id, ServiceId, ServiceQualifiedName, + INSERT OR IGNORE INTO contract_messages (Id, ServiceId, ServiceQualifiedName, ChannelName, OperationType, MessageName, Title, ContentType, PropertyCount, ModuleName, ProjectId, SnapshotId, SnapshotDate, SnapshotSource) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)