debug: add diagnostic logs to trace history merge for 59272EN

This commit is contained in:
Christian Vidal Wolf
2026-04-23 19:14:10 +02:00
parent c1e3960a20
commit 7ef9f62497
2 changed files with 20 additions and 0 deletions
+7
View File
@@ -206,6 +206,8 @@ export async function getHistoryDataForMerge(): Promise<Record<string, ExcelRow>
return {};
}
const entries: Array<{ product_id: string; new_data: ExcelRow }> = await response.json();
console.log('[getHistoryDataForMerge] Raw entries:', entries.length);
console.log('[getHistoryDataForMerge] Has 59272EN?:', entries.some(e => e.product_id === '59272EN'));
const result: Record<string, ExcelRow> = {};
const seen = new Set<string>();
@@ -216,6 +218,11 @@ export async function getHistoryDataForMerge(): Promise<Record<string, ExcelRow>
result[entry.product_id] = entry.new_data;
}
}
console.log('[getHistoryDataForMerge] Deduplicated count:', Object.keys(result).length);
console.log('[getHistoryDataForMerge] result[59272EN]?:', !!result['59272EN']);
if (result['59272EN']) {
console.log('[getHistoryDataForMerge] result[59272EN][103]:', result['59272EN'][103]);
}
return result;
} catch (error: any) {
console.error('[getHistoryDataForMerge] Exception:', error.message);