fix: treat fetched_at=None as stale, bump 0.4.4
This commit is contained in:
@@ -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
2
Cargo.lock
generated
@@ -1368,7 +1368,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "k-ap"
|
||||
version = "0.4.3"
|
||||
version = "0.4.4"
|
||||
dependencies = [
|
||||
"activitypub_federation",
|
||||
"anyhow",
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user