From 2c5217e744307758e25b69d871949536b8d3f11e Mon Sep 17 00:00:00 2001 From: Jeena Date: Sun, 22 Mar 2026 01:58:51 +0000 Subject: [PATCH] api: fix unread detection broken by substring match MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The check `.contains("user/-/state/com.google/read")` was a substring match, which also matched "user/-/state/com.google/reading-list" — a category present on every article fetched from the reading list. This caused all articles to be treated as read, so nothing ever appeared bold in the sidebar. Fix by using == for exact string comparison. --- src/api.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api.rs b/src/api.rs index 59a96a3..c3db913 100644 --- a/src/api.rs +++ b/src/api.rs @@ -148,7 +148,7 @@ impl Api { Ok(stream.items.into_iter().map(|item| { let unread = !item.categories.as_deref().unwrap_or_default() .iter() - .any(|c| c.contains("user/-/state/com.google/read")); + .any(|c| c == "user/-/state/com.google/read"); let content = item.summary .as_ref() .and_then(|s| s.content.clone())