debug: Add diagnostics for Buy Box warning issue

This commit is contained in:
Christian Vidal Wolf
2026-02-05 08:43:58 +01:00
parent 09e06bad16
commit 9a042c6478
2 changed files with 9 additions and 4 deletions
+5
View File
@@ -19,6 +19,11 @@ export const BuyBoxWarningBadge: React.FC<BuyBoxWarningBadgeProps> = ({ asin, bu
if (!buyBoxLostMap || !asin) return null;
const data = buyBoxLostMap.get(asin.toUpperCase());
if (asin.toUpperCase() === 'B0D3874WSD') {
console.log(`[BuyBoxBadge Debug] ASIN: ${asin}, Found in map: ${!!data}, Countries: ${data?.countries.join(', ') || 'none'}`);
}
if (!data || data.countries.length === 0) return null;
return (
+4 -4
View File
@@ -2216,14 +2216,14 @@ export const processBuyBoxExcel = async (fileOrBuffer: File | ArrayBuffer): Prom
const rawReason = String(row[reasonIdx] || '').trim();
// Debug specific ASIN reported by user
if (rawAsin === 'B0D3874WSD' && config.country === 'ES') {
console.log(`[BuyBox Debug] ASIN B0D3874WSD found in ES. Raw Reason: "${rawReason}" (Length: ${rawReason.length})`);
if (rawAsin === 'B0D3874WSD' || rawAsin.includes('B0D3874WSD')) {
console.log(`[BuyBox Debug] ASIN ${rawAsin} found in ${config.country}. Headers:`, headers);
console.log(`[BuyBox Debug] Reason at index ${reasonIdx}: "${rawReason}" (Length: ${rawReason.length})`);
}
// Only consider as BB lost if there is an Issue Type / Reason specified
// Empty reason or "Fixed" status means no issue = they have the Buy Box
const lowReason = rawReason.toLowerCase();
if (!rawReason || lowReason === 'fixed' || lowReason === 'ok' || lowReason === 'hecho' || lowReason === 'solucionado') continue;
if (!rawReason || lowReason === 'fixed' || lowReason === 'ok' || lowReason === 'hecho' || lowReason === 'solucionado' || lowReason === 'corrected') continue;
let entry = buyBoxMap.get(rawAsin);
if (!entry) {