fix: treat fetched_at=None as stale, bump 0.4.4

This commit is contained in:
2026-07-11 10:37:11 +02:00
parent 00ec90fb03
commit 6e1e1357fb
4 changed files with 14 additions and 3 deletions

View File

@@ -1,5 +1,13 @@
# Changelog
## [0.4.4] — 2026-07-11
### Bug fixes
- Actor cache TTL now treats `fetched_at: None` as always-stale instead of always-fresh. Consumers who never populated `fetched_at` were silently getting no cache invalidation.
---
## [0.4.3] — 2026-07-11
### Bug fixes

2
Cargo.lock generated
View File

@@ -1368,7 +1368,7 @@ dependencies = [
[[package]]
name = "k-ap"
version = "0.4.3"
version = "0.4.4"
dependencies = [
"activitypub_federation",
"anyhow",

View File

@@ -1,6 +1,6 @@
[package]
name = "k-ap"
version = "0.4.3"
version = "0.4.4"
edition = "2024"
description = "Generic ActivityPub protocol layer"
license = "MIT"

View File

@@ -39,7 +39,10 @@ impl ActivityPubService {
let age = chrono::Utc::now().signed_duration_since(t);
age < chrono::Duration::from_std(data.actor_cache_ttl).unwrap_or_default()
})
.unwrap_or(true);
.unwrap_or_else(|| {
tracing::debug!(actor_url, "fetched_at is None, treating as stale — consider populating fetched_at in get_remote_actor()");
false
});
if is_fresh {
return Ok(cached);
}