diff --git a/src/modules/feeder/feeder.service.ts b/src/modules/feeder/feeder.service.ts index f804f4d..389e67a 100755 --- a/src/modules/feeder/feeder.service.ts +++ b/src/modules/feeder/feeder.service.ts @@ -310,9 +310,20 @@ export class FeederService { const { startTs: targetDateStartTs, endTs: targetDateEndTs } = this.getDayBoundsForTimeZone(dateString, this.DAILY_SYNC_TIME_ZONE); + // DEBUG: Log sample mstUtc values vs target bounds to diagnose filtering + if (allMatches.length > 0) { + const sample = allMatches.slice(0, 3); + this.logger.warn( + `[${sport}] [${dateString}] DEBUG: bounds=[${targetDateStartTs}, ${targetDateEndTs}] ` + + `(${new Date(targetDateStartTs * 1000).toISOString()} - ${new Date(targetDateEndTs * 1000).toISOString()}) | ` + + `sampleMstUtc=[${sample.map((m) => `${m.mstUtc} (asSec=${new Date(m.mstUtc * 1000).toISOString()}, asMs=${new Date(m.mstUtc).toISOString()})`).join(', ')}]`, + ); + } + const dateFilteredMatches = allMatches.filter((m) => { - const matchTs = m.mstUtc; - return matchTs >= targetDateStartTs && matchTs <= targetDateEndTs; + // mstUtc is in milliseconds from API, bounds are in seconds + const matchTsSec = Math.floor(m.mstUtc / 1000); + return matchTsSec >= targetDateStartTs && matchTsSec <= targetDateEndTs; }); const apiReturnedCount = allMatches.length;