fix(writer-pipeline): detect revista leads by URL when sourceKind missing
Tests / bridge tests (push) Successful in 2m6s
Tests / writer-pipeline tests (pull_request) Successful in 2m1s
Tests / writer-pipeline tests (push) Successful in 2m12s
Tests / frontend lib tests (push) Successful in 2m6s
Tests / bridge tests (pull_request) Successful in 43s
Tests / frontend lib tests (pull_request) Successful in 33s

Synthetic /revista-imprensa/ URLs without sourceKind skipped the publisher
image probe and threw Mandatory featured image (ERRSIG 88492922d213).

Paperclip-Issue: BIT-27615
Paperclip-Run: 17d5ee4b-579f-4833-943f-ea9e815e5dec
This commit is contained in:
José Alves committed 2026-07-27 06:20:21 +00:00
1 parent 9a2f82d825
commit 60366a95ae
2 files changed
+12 -3

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;
}