From abbbd6eac7788f31dfa31103a9678be6936f05a5 Mon Sep 17 00:00:00 2001 From: dal Date: Mon, 25 Aug 2025 09:26:27 -0600 Subject: [PATCH] make update message entries await --- .../src/queries/messages/update-message-entries.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/packages/database/src/queries/messages/update-message-entries.ts b/packages/database/src/queries/messages/update-message-entries.ts index ba2a41840..0bb442705 100644 --- a/packages/database/src/queries/messages/update-message-entries.ts +++ b/packages/database/src/queries/messages/update-message-entries.ts @@ -78,14 +78,11 @@ export async function updateMessageEntries({ updateData.rawLlmMessages = mergedEntries.rawLlmMessages; } - // Non-blocking DB update - don't await - db.update(messages) + // Update database for persistence + await db + .update(messages) .set(updateData) - .where(and(eq(messages.id, messageId), isNull(messages.deletedAt))) - .catch((error) => { - // Log but don't fail - cache has the truth - console.error('Background DB update failed (cache still valid):', error); - }); + .where(and(eq(messages.id, messageId), isNull(messages.deletedAt))); return { success: true }; } catch (error) {