From b711bb9678b8aff270ccdfda1523a831dc233683 Mon Sep 17 00:00:00 2001 From: Joe Prosser Date: Mon, 5 Aug 2024 15:11:37 +0100 Subject: [PATCH 1/2] chore(api): retry put comments requests --- CHANGELOG.md | 1 + api/src/lib.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c6789e..63341b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ # Unreleased +- Retry when putting comments - Add ability to upload attachment content for comments # v0.29.0 diff --git a/api/src/lib.rs b/api/src/lib.rs index 4125aba..53b42bb 100644 --- a/api/src/lib.rs +++ b/api/src/lib.rs @@ -510,7 +510,7 @@ impl Client { self.endpoints.put_comments(source_name)?, PutCommentsRequest { comments }, Some(NoChargeQuery { no_charge }), - Retry::No, + Retry::Yes, ) } @@ -525,7 +525,7 @@ impl Client { &self.endpoints.put_comments(source_name)?, &Some(PutCommentsRequest { comments }), &Some(NoChargeQuery { no_charge }), - &Retry::No, + &Retry::Yes, ) } From e47683fe09681d9ecf33940ed58a67c5d30d36ae Mon Sep 17 00:00:00 2001 From: Joe Prosser Date: Mon, 5 Aug 2024 16:31:25 +0100 Subject: [PATCH 2/2] add retry comment --- api/src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/api/src/lib.rs b/api/src/lib.rs index 53b42bb..e5a42a8 100644 --- a/api/src/lib.rs +++ b/api/src/lib.rs @@ -505,6 +505,9 @@ impl Client { comments: Vec, no_charge: bool, ) -> Result> { + // Retrying here despite the potential for 409's in order to increase reliability when + // working with poor connection + self.splitable_request( Method::PUT, self.endpoints.put_comments(source_name)?, @@ -520,6 +523,8 @@ impl Client { comments: Vec, no_charge: bool, ) -> Result { + // Retrying here despite the potential for 409's in order to increase reliability when + // working with poor connection self.request( &Method::PUT, &self.endpoints.put_comments(source_name)?,