diff --git a/api/src/logic/backfills/moves-master-backfill.ts b/api/src/logic/backfills/moves-master-backfill.ts index 9056022..523aae8 100644 --- a/api/src/logic/backfills/moves-master-backfill.ts +++ b/api/src/logic/backfills/moves-master-backfill.ts @@ -16,7 +16,9 @@ function validateMovesMasterBackfillData(data: BackfillData): boolean { return ( Number.isInteger(data.progress.usedEmotesCount) && Array.isArray(data.progress.achievedTier) && - data.progress.achievedTier.every((tier) => Number.isInteger(tier.steps) && Number.isInteger(tier.completedAt)) && + data.progress.achievedTier.every( + (tier) => Number.isInteger(tier.steps) || (!isNaN(Number(tier.steps)) && Number.isInteger(tier.completedAt)) + ) && Number.isInteger(data.progress.lastEmoteTriggeredAt) && data.progress.lastEmoteTriggeredAt > 0 ) @@ -46,7 +48,7 @@ export function mergeMovesMasterProgress( try { backfillData.progress.achievedTier.forEach((tier) => { - const achievedTier = badge.tiers?.find((badgeTier) => badgeTier.criteria.steps === tier.steps) + const achievedTier = badge.tiers?.find((badgeTier) => badgeTier.criteria.steps === Number(tier.steps)) if (!achievedTier) { throw new Error('tierId received is invalid, breaking backfill')