fix(writer-pipeline): revista featured image without sourceKind (BIT-27615) #36

Merged
spark merged 1 commits from fix/BIT-27615-revista-featured-sourcekind into main 2026-07-27 07:23:47 +01:00
2 changed files with 12 additions and 3 deletions

No files matched your search

+2
View File
@@ -70,6 +70,8 @@ export function upsertItem(store: StoreFile, item: AggregatedItem): { store: Sto
skippedReason: prev.skippedReason,
featuredImageUrl: item.featuredImageUrl ?? prev.featuredImageUrl,
featuredImageCredit: item.featuredImageCredit ?? prev.featuredImageCredit,
// Preserve ingest provenance when a later upsert omits sourceKind (BIT-27615).
sourceKind: item.sourceKind ?? prev.sourceKind,
};
} else next.items.push(item);
return { store: next, isNew };
+10 -3
View File
@@ -159,8 +159,15 @@ export async function resolveFeaturedImageForDraft(item: AggregatedItem): Promis
webDavEnvError = e instanceof Error ? e.message : String(e);
}
if (item.sourceKind === 'revista_imprensa') {
const publisherHome = publisherHomeUrlForRevistaLead(item.url);
// Synthetic /revista-imprensa/ leads are not real article pages (BIT-25590). Detect by
// URL path as well as sourceKind — store upserts that omit sourceKind used to fall
// through and throw Mandatory featured image (BIT-27615 / ERRSIG 88492922d213).
const revistaPublisherHome = publisherHomeUrlForRevistaLead(item.url);
const isRevistaLead =
item.sourceKind === 'revista_imprensa' || revistaPublisherHome != null;
if (isRevistaLead) {
const publisherHome = revistaPublisherHome;
if (publisherHome) {
const fromPublisher = await featuredImageFromPageHtml(publisherHome, item.featuredImageCredit);
if (fromPublisher) return fromPublisher;
@@ -177,7 +184,7 @@ export async function resolveFeaturedImageForDraft(item: AggregatedItem): Promis
return resolveFeaturedFromWebDavArchive(webDavCfg, item);
}
if (item.sourceKind === 'revista_imprensa') {
if (isRevistaLead) {
return null;
}