From 946812a362ae82ee6d3cf33afeab1e71bcfcd74b Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Tue, 21 Jan 2025 17:52:09 +1100 Subject: [PATCH] chore: fix typo --- .../apis/snode_api/factories/StoreGroupRequestFactory.ts | 2 +- ts/session/apis/snode_api/swarmPolling.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ts/session/apis/snode_api/factories/StoreGroupRequestFactory.ts b/ts/session/apis/snode_api/factories/StoreGroupRequestFactory.ts index 4bc621747..e41bcb91a 100644 --- a/ts/session/apis/snode_api/factories/StoreGroupRequestFactory.ts +++ b/ts/session/apis/snode_api/factories/StoreGroupRequestFactory.ts @@ -43,7 +43,7 @@ async function makeGroupMessageSubRequest( const allTimestamps = uniqBy(compactedMessages, m => m.createAtNetworkTimestamp); if (allTimestamps.length !== compactedMessages.length) { throw new Error( - 'tried to send batch request with messages having the same timestamp, and some platformn do not support this.' + 'tried to send batch request with messages having the same timestamp, this is not supported on all platforms.' ); } diff --git a/ts/session/apis/snode_api/swarmPolling.ts b/ts/session/apis/snode_api/swarmPolling.ts index 1b502d0c8..0d06fbb0e 100644 --- a/ts/session/apis/snode_api/swarmPolling.ts +++ b/ts/session/apis/snode_api/swarmPolling.ts @@ -134,7 +134,7 @@ function mergeMultipleRetrieveResults( // Convert the merged map back to an array return Array.from(mapped.entries()).map(([namespace, messagesMap]) => ({ - code: 200, // Assuming success code, adjust as needed + code: results.find(m => m.namespace === namespace)?.code || 200, namespace, messages: { messages: Array.from(messagesMap.values()) }, })); @@ -477,7 +477,7 @@ export class SwarmPolling { }) ); window.log.info( - `SwarmPolling: pollNodeForKey of ${ed25519Str(pubkey)} namespaces: ${namespaces} returned ${resultsFromAllSnodesSettled.filter(m => m.status === 'fulfilled')}/${RETRIEVE_SNODES_COUNT} fulfilled promises` + `SwarmPolling: pollNodeForKey of ${ed25519Str(pubkey)} namespaces: ${namespaces} returned ${resultsFromAllSnodesSettled.filter(m => m.status === 'fulfilled').length}/${RETRIEVE_SNODES_COUNT} fulfilled promises` ); resultsFromAllNamespaces = mergeMultipleRetrieveResults( compact(