From 2414559b80ae9916aaa01bcc8da4f8b4cbf64238 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Mon, 20 May 2024 09:56:57 -0500 Subject: [PATCH] =?UTF-8?q?[=F0=9F=90=B4]=20Don't=20retry=20sends=20(#4111?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Don't retry sends * Don't retry batch sends --- src/state/messages/convo/agent.ts | 37 +++++++++++++------------------ 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/src/state/messages/convo/agent.ts b/src/state/messages/convo/agent.ts index 4418eaae..71b0b6f2 100644 --- a/src/state/messages/convo/agent.ts +++ b/src/state/messages/convo/agent.ts @@ -793,15 +793,13 @@ export class Convo { const {id, message} = pendingMessage - const response = await networkRetry(2, () => { - return this.agent.api.chat.bsky.convo.sendMessage( - { - convoId: this.convoId, - message, - }, - {encoding: 'application/json', headers: DM_SERVICE_HEADERS}, - ) - }) + const response = await this.agent.api.chat.bsky.convo.sendMessage( + { + convoId: this.convoId, + message, + }, + {encoding: 'application/json', headers: DM_SERVICE_HEADERS}, + ) const res = response.data // remove from queue @@ -883,18 +881,15 @@ export class Convo { ) try { - // throw new Error('UNCOMMENT TO TEST RETRY') - const {data} = await networkRetry(2, () => { - return this.agent.api.chat.bsky.convo.sendMessageBatch( - { - items: messageArray.map(({message}) => ({ - convoId: this.convoId, - message, - })), - }, - {encoding: 'application/json', headers: DM_SERVICE_HEADERS}, - ) - }) + const {data} = await this.agent.api.chat.bsky.convo.sendMessageBatch( + { + items: messageArray.map(({message}) => ({ + convoId: this.convoId, + message, + })), + }, + {encoding: 'application/json', headers: DM_SERVICE_HEADERS}, + ) const {items} = data /*