diff --git a/writer-pipeline/src/store.ts b/writer-pipeline/src/store.ts index e4c7d00..c997489 100644 --- a/writer-pipeline/src/store.ts +++ b/writer-pipeline/src/store.ts @@ -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 }; diff --git a/writer-pipeline/src/wp-publish.ts b/writer-pipeline/src/wp-publish.ts index 84c9d9b..da8a7ba 100644 --- a/writer-pipeline/src/wp-publish.ts +++ b/writer-pipeline/src/wp-publish.ts @@ -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; }