From 0e40b62466985b7ac9bca63c9e61a4cad63d2144 Mon Sep 17 00:00:00 2001 From: padreug Date: Wed, 6 Aug 2025 00:57:25 +0200 Subject: [PATCH] feat: Prevent duplicate message processing in Nostr chat - Add logic to track processed message IDs, ensuring that messages are not processed multiple times, which enhances the reliability of message handling in the chat component. --- src/composables/useNostrChat.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/composables/useNostrChat.ts b/src/composables/useNostrChat.ts index 6815da7..222e119 100644 --- a/src/composables/useNostrChat.ts +++ b/src/composables/useNostrChat.ts @@ -417,6 +417,9 @@ export function useNostrChat() { pubkey: currentUser.value.pubkey } + // Add to processed IDs to prevent duplicate processing + processedMessageIds.value.add(event.id) + if (!messages.value.has(peerPubkey)) { messages.value.set(peerPubkey, []) }