stabilize ids and harden release pipeline

This commit is contained in:
2026-11-12 20:42:50 +07:00
parent fd802a8870
commit e9f29dc398
28 changed files with 1199 additions and 281 deletions
+2 -5
View File
@@ -1,10 +1,9 @@
use std::collections::HashSet;
use std::collections::hash_map::DefaultHasher;
use std::fmt;
use std::hash::{Hash, Hasher};
use std::str::FromStr;
use anyhow::{Result, anyhow, bail};
use common::stable_id_u64;
use nostr_sdk::prelude::*;
pub(crate) const TIMELINE_WINDOW: usize = 50;
@@ -289,9 +288,7 @@ impl GroupKey {
}
pub fn uniq_id(&self) -> u64 {
let mut hasher = DefaultHasher::new();
self.hash(&mut hasher);
hasher.finish()
stable_id_u64(&[self.relay.as_str(), self.id.as_str()])
}
}
+5 -6
View File
@@ -1,7 +1,6 @@
use std::collections::HashSet;
use std::collections::hash_map::DefaultHasher;
use std::hash::{Hash, Hasher};
use common::stable_id_u64;
use nostr_sdk::prelude::*;
use crate::{GroupId, GroupKey};
@@ -25,10 +24,10 @@ pub(crate) fn subscription_id(key: &GroupKey) -> SubscriptionId {
}
pub(crate) fn browse_subscription(relay: &RelayUrl) -> SubscriptionId {
let mut hasher = DefaultHasher::new();
relay.hash(&mut hasher);
SubscriptionId::new(format!("{BROWSE_PREFIX}{:08x}", hasher.finish() as u32))
SubscriptionId::new(format!(
"{BROWSE_PREFIX}{:08x}",
stable_id_u64(&[relay.as_str()]) as u32
))
}
pub(crate) fn page_subscription(key: &GroupKey) -> SubscriptionId {