feat: processed-event ledger, idempotent dispatch

This commit is contained in:
2026-10-26 00:17:28 +01:00
parent fa8e94817a
commit 5681d0c034
29 changed files with 610 additions and 24 deletions

View File

@@ -107,3 +107,34 @@ async fn server_publishes_to_the_outbox_even_when_bus_is_nats() {
.unwrap();
assert_eq!(queued, 1);
}
/// Handler names key the processed-event ledger, so each must be unique. The
/// check runs over the real wiring, in both federation builds.
#[tokio::test]
async fn handler_names_are_unique() {
let pool = support::memory_pool().await;
let worker = bootstrap::build_worker_on(&support::test_config(), pool)
.await
.expect("worker builds");
let names = worker.handler_names();
let unique: std::collections::HashSet<_> = names.iter().collect();
assert_eq!(
unique.len(),
names.len(),
"duplicate handler name in {names:?}"
);
for core in [
"poster_sync",
"image_cleanup",
"search_cleanup",
"search_reindex",
] {
assert!(names.contains(&core), "{core} missing from {names:?}");
}
assert_eq!(
names.contains(&"activitypub"),
cfg!(feature = "federation"),
"{names:?}"
);
}