fix(writer-pipeline): revista featured image without sourceKind (BIT-27615) #36
No files matched your search
@@ -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 };
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user