Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure all forms of request failure on a feed are not treated as a parsing failure by metrics #816

Merged
merged 4 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/816.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix feed metrics treating request failures as parsing failures.
2 changes: 1 addition & 1 deletion src/feeds/FeedReader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ export class FeedReader {
this.queue.push<FeedEntry>({ eventName: 'feed.entry', sender: 'FeedReader', data: entry });
}

if (seenEntriesChanged) {
if (seenEntriesChanged && newGuids.length) {
await this.storage.storeFeedGuids(url, ...newGuids);
}

Expand Down
7 changes: 5 additions & 2 deletions src/feeds/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,13 @@ pub async fn js_read_feed(url: String, options: ReadFeedOptions) -> Result<FeedR
}),
status => 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),
)),
}
}
Loading