From 77d7d3aef6079515ce4c6345f631d24f60588291 Mon Sep 17 00:00:00 2001 From: Rahix Date: Sun, 5 Oct 2025 18:59:47 +0200 Subject: [PATCH] Introduce a digest epoch To add a mechanism for updating all issue comments after a code change, introduce a HASH_EPOCH constant which gets mixed into the stable hash for each issue. Changing this value will force all issue comments to be updated. --- techtree-manager/src/tree.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/techtree-manager/src/tree.rs b/techtree-manager/src/tree.rs index fef523d..db6a93f 100644 --- a/techtree-manager/src/tree.rs +++ b/techtree-manager/src/tree.rs @@ -2,6 +2,8 @@ use std::collections::BTreeMap; use petgraph::visit::EdgeRef as _; +const HASH_EPOCH: u32 = 0x00000001; + /// Element in the techtree #[derive(Debug, Clone, Hash, PartialEq, Eq, serde::Serialize)] pub struct Element { @@ -420,7 +422,7 @@ impl<'a> Subtree<'a> { .collect(); edges.sort(); - let json_data = serde_json::ser::to_string(&(nodes, edges)).unwrap(); + let json_data = serde_json::ser::to_string(&(nodes, edges, HASH_EPOCH)).unwrap(); sha256::digest(json_data) } }