From 3a9bfa48a670ee92741edd8f37e61f18795145ff Mon Sep 17 00:00:00 2001 From: Tej Kotthakota Date: Tue, 4 Aug 2026 11:38:22 -0500 Subject: [PATCH] fix(onboard-status): show no-scrape-data scraping state as neutral, not failed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follow-up to #340 (merged): the onboarding status report mapped the 'unknown' scraping state (no scrape data yet) to ❌, which reads as a failure on an early snapshot of a not-yet-scraped site — the running-vs-failed conflation #340 set out to remove. Map 'unknown' to a neutral info icon (ℹ️): not ❌ (false failure) and not ⏳ (overclaims active progress). A genuinely terminal-failed scrape (0 completed, 0 pending, >0 failed) still resolves to ❌ via the tri-state. Mirrors the same fix in spacecat-api-service's onboard-status command, keeping the two deriveScrapingStatus consumers in sync. Co-Authored-By: Claude Opus 4.8 --- src/tasks/opportunity-status-processor/handler.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/tasks/opportunity-status-processor/handler.js b/src/tasks/opportunity-status-processor/handler.js index fcc1b85..75203f1 100644 --- a/src/tasks/opportunity-status-processor/handler.js +++ b/src/tasks/opportunity-status-processor/handler.js @@ -606,11 +606,16 @@ export async function runOpportunityStatusProcessor(message, context) { const seoImportStatus = seoImportAvailable ? ':white_check_mark:' : ':x:'; const gscStatus = gscConfigured ? ':white_check_mark:' : ':x:'; // Tri-state scraping: hourglass while URLs are still being scraped, so an - // in-progress snapshot is not mislabelled as a failure. + // in-progress snapshot is not mislabelled as a failure. 'unknown' (no scrape data + // yet) shows a neutral info icon — not ❌ (which would falsely read as failed) and + // not ⏳ (which would overclaim active progress). Only a genuinely terminal-failed + // scrape (0 completed, 0 pending, >0 failed) shows ❌. const scrapingStatusKey = deriveScrapingStatus(scrapingStats); const scrapingEmoji = { available: ':white_check_mark:', in_progress: ':hourglass_flowing_sand:', + unknown: ':information_source:', + failed: ':x:', }[scrapingStatusKey] || ':x:'; const scrapingStatus = scrapingEmoji;