From 69f31251c74eb3f4ad28252250f2c2df23b47259 Mon Sep 17 00:00:00 2001 From: Half-Shot Date: Thu, 14 Sep 2023 10:56:25 +0100 Subject: [PATCH 1/4] Only upload feed items when newGuids is non-zero --- src/feeds/FeedReader.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/feeds/FeedReader.ts b/src/feeds/FeedReader.ts index c2760cad3..46ccadb2c 100644 --- a/src/feeds/FeedReader.ts +++ b/src/feeds/FeedReader.ts @@ -240,7 +240,7 @@ export class FeedReader { this.queue.push({ eventName: 'feed.entry', sender: 'FeedReader', data: entry }); } - if (seenEntriesChanged) { + if (seenEntriesChanged && newGuids.length) { await this.storage.storeFeedGuids(url, ...newGuids); } From c7d08a0c65ee4a465d9de853bfafba7b3ee35f35 Mon Sep 17 00:00:00 2001 From: Half-Shot Date: Thu, 14 Sep 2023 10:56:34 +0100 Subject: [PATCH 2/4] Log other request failures as HTTP errors --- src/feeds/parser.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/feeds/parser.rs b/src/feeds/parser.rs index 3d33a74e7..b9ee34364 100644 --- a/src/feeds/parser.rs +++ b/src/feeds/parser.rs @@ -226,10 +226,13 @@ pub async fn js_read_feed(url: String, options: ReadFeedOptions) -> Result Err(JsError::new( Status::Unknown, - format!("Failed to fetch feed due to HTTP {}", status), + format!("Failed to fetch feed due to HTTP status {}", status), )), } } - Err(err) => Err(JsError::new(Status::Unknown, err)), + Err(err) => Err(JsError::new( + Status::Unknown, + format!("Failed to fetch feed due to HTTP error {}", err), + )) } } From beb55a42b4bc0158b7fe58a622a928e63b40f89d Mon Sep 17 00:00:00 2001 From: Half-Shot Date: Thu, 14 Sep 2023 10:57:20 +0100 Subject: [PATCH 3/4] changelog --- changelog.d/816.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/816.bugfix diff --git a/changelog.d/816.bugfix b/changelog.d/816.bugfix new file mode 100644 index 000000000..4f753e4d1 --- /dev/null +++ b/changelog.d/816.bugfix @@ -0,0 +1 @@ +Fix feed metrics treating request failures as parsing failures. From 65ca64a23fea2f6080d8a8e25405d0fa1bfa2392 Mon Sep 17 00:00:00 2001 From: Half-Shot Date: Mon, 25 Sep 2023 09:17:14 +0100 Subject: [PATCH 4/4] Rust lint --- src/feeds/parser.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/feeds/parser.rs b/src/feeds/parser.rs index b9ee34364..0dcbc7d16 100644 --- a/src/feeds/parser.rs +++ b/src/feeds/parser.rs @@ -233,6 +233,6 @@ pub async fn js_read_feed(url: String, options: ReadFeedOptions) -> Result Err(JsError::new( Status::Unknown, format!("Failed to fetch feed due to HTTP error {}", err), - )) + )), } }