From 93c451048a3bb1947883a2c20688015a1b005497 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Mon, 25 Nov 2024 10:39:28 +1100 Subject: [PATCH] fix: base64 zod doesn't work for us also fix delete in a private chat --- ts/interactions/conversations/unsendingInteractions.ts | 3 ++- ts/session/apis/snode_api/swarmPolling.ts | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ts/interactions/conversations/unsendingInteractions.ts b/ts/interactions/conversations/unsendingInteractions.ts index 06995fdd1..b7df6180d 100644 --- a/ts/interactions/conversations/unsendingInteractions.ts +++ b/ts/interactions/conversations/unsendingInteractions.ts @@ -227,9 +227,10 @@ export async function deleteMessagesFromSwarmAndCompletelyLocally( throw new Error('deleteMessagesFromSwarmAndCompletelyLocally needs a 03 or 05 pk'); } if (PubKey.is05Pubkey(pubkey) && pubkey !== UserUtils.getOurPubKeyStrFromCache()) { - throw new Error( + window.log.warn( 'deleteMessagesFromSwarmAndCompletelyLocally with 05 pk can only delete for ourself' ); + return; } // LEGACY GROUPS -- we cannot delete on the swarm (just unsend which is done separately) if (conversation.isClosedGroup() && PubKey.is05Pubkey(pubkey)) { diff --git a/ts/session/apis/snode_api/swarmPolling.ts b/ts/session/apis/snode_api/swarmPolling.ts index f62ea8e16..b9e40e3c4 100644 --- a/ts/session/apis/snode_api/swarmPolling.ts +++ b/ts/session/apis/snode_api/swarmPolling.ts @@ -940,8 +940,8 @@ export class SwarmPolling { // zod schema for retrieve items as returned by the snodes const retrieveItemSchema = z.object({ - hash: z.string().base64('retrieveItemSchema: hash was not base64'), - data: z.string().base64('retrieveItemSchema: data was not base64'), + hash: z.string(), + data: z.string(), expiration: z.number().finite(), timestamp: z.number().finite().positive(), });