From 8eaf4c5956e5dd8959f01de33fc7b512a8283377 Mon Sep 17 00:00:00 2001 From: ProofOfConcept Date: Thu, 26 Mar 2026 19:18:14 -0400 Subject: [PATCH] digest: use created_at instead of timestamp for date matching Episodic entries should be grouped by creation date, not last update date. Fixes digest generation potentially assigning updated entries to the wrong day. Co-Authored-By: Kent Overstreet --- src/subconscious/digest.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/subconscious/digest.rs b/src/subconscious/digest.rs index 5791044..9cc92ef 100644 --- a/src/subconscious/digest.rs +++ b/src/subconscious/digest.rs @@ -156,8 +156,8 @@ fn gather(level: &DigestLevel, store: &Store, arg: &str) -> Result = store.nodes.iter() .filter(|(_, n)| n.node_type == store::NodeType::EpisodicSession - && n.timestamp > 0 - && store::format_date(n.timestamp) == label) + && n.created_at > 0 + && store::format_date(n.created_at) == label) .map(|(key, n)| { (store::format_datetime(n.timestamp), n.content.clone(), key.clone()) }) @@ -298,8 +298,8 @@ pub fn digest_auto(store: &mut Store) -> Result<(), String> { // Collect all dates with episodic entries let dates: Vec = store.nodes.values() - .filter(|n| n.node_type == store::NodeType::EpisodicSession && n.timestamp > 0) - .map(|n| store::format_date(n.timestamp)) + .filter(|n| n.node_type == store::NodeType::EpisodicSession && n.created_at > 0) + .map(|n| store::format_date(n.created_at)) .collect::>() .into_iter() .collect();