strip session-added comments
Some checks failed
CI / Check / Test (push) Has been cancelled
CI / Check / Test (pull_request) Has been cancelled

This commit is contained in:
2026-10-26 10:32:38 +01:00
parent a270632e87
commit f020108024
138 changed files with 0 additions and 719 deletions

View File

@@ -1,6 +1,3 @@
//! Every event handler may run twice for the same event (lease takeover after
//! a crash mid-handler). Running it twice must leave the world as if it ran once.
use std::collections::HashMap;
use std::sync::{
Arc, Mutex,
@@ -36,7 +33,6 @@ use application::person::event_handler::PersonEnrichmentHandler;
// ── fakes ───────────────────────────────────────────────────────────────────
/// Search index keyed like a real one: indexing the same id twice is one doc.
#[derive(Default)]
struct RecordingSearch {
docs: Mutex<HashMap<(String, String), u32>>,
@@ -79,7 +75,6 @@ impl SearchCommand for RecordingSearch {
}
}
/// Fails the first `index` call, succeeds afterwards.
struct FlakySearch {
inner: Arc<RecordingSearch>,
failed_once: AtomicUsize,
@@ -103,7 +98,6 @@ fn person(tmdb: u64, name: &str) -> Person {
Person::basic(PersonId::from_external(&ext), ext, name.into(), None, None)
}
/// One person whose `enriched_at` is set by `update_enrichment`, like the real store.
struct FakePersons {
person: Mutex<Person>,
enrich_writes: AtomicUsize,
@@ -239,7 +233,6 @@ impl domain::ports::ImageFetcher for NoImages {
}
}
/// Returns the key it was given, like the real adapter.
struct KeyStorage;
#[async_trait]
@@ -371,8 +364,6 @@ async fn a_movie_enrichment_that_failed_midway_is_redone_on_redelivery() {
};
assert!(handler.handle(&event).await.is_err());
// The profile row is the "enrichment done" marker: it must not exist yet,
// or the redelivery below would skip and the search index would stay empty.
assert!(store.get_by_movie_id(movie.id()).await.unwrap().is_none());
handler.handle(&event).await.unwrap();
@@ -517,13 +508,11 @@ async fn poster_sync_skips_converted_poster_keys_but_not_lookalike_paths() {
external_metadata_id: ext,
};
// The converter's output is the canonical synced key: skipped.
movie.update_poster(PosterPath::new(format!("{id}.webp")).unwrap());
store.upsert_movie(&movie, &[]).await.unwrap();
handler.handle(&event).await.unwrap();
assert!(publisher.published().is_empty());
// A foreign path that merely contains the id is not a synced poster.
movie.update_poster(PosterPath::new(format!("https://cdn.example/{id}/p.jpg")).unwrap());
store.upsert_movie(&movie, &[]).await.unwrap();
handler.handle(&event).await.unwrap();