@@ -1811,32 +1811,25 @@ function dedupeUnifiedHistoryRows (rows) {
18111811}
18121812
18131813/**
1814- * Remove empty imported Marathon Match rows that still reference unmapped numeric
1814+ * Remove imported Marathon Match rows that still reference unmapped numeric
18151815 * legacy challenge ids.
18161816 *
1817- * Older Marathon Match histories can predate challenge-api metadata while still
1818- * carrying rating, placement, or percentile data from the members schema. Those
1819- * rows are part of the member's rating timeline and must remain visible even
1820- * when a challenge title cannot be resolved.
1817+ * Resolved legacy ids are canonicalized before this point. Any remaining
1818+ * numeric MM challenge id cannot be matched to challenge-api metadata, so it is
1819+ * ignored to avoid surfacing stale legacy rating rows or double-counting history.
18211820 *
18221821 * @param {Array<Object> } rows persisted and/or transient history rows
1823- * @returns {Array<Object> } history rows without empty unresolved legacy MM entries
1822+ * @returns {Array<Object> } history rows without unresolved legacy MM entries
18241823 */
1825- function filterEmptyUnresolvedLegacyMarathonHistoryRows ( rows ) {
1824+ function filterUnresolvedLegacyMarathonHistoryRows ( rows ) {
18261825 return _ . filter ( rows || [ ] , ( row ) => {
18271826 const challengeId = normalizeChallengeLookupKey ( row && row . challengeId )
18281827 const isLegacyNumericChallenge = challengeId && / ^ \d + $ / . test ( challengeId )
18291828 const isMarathonHistory = row &&
18301829 row . trackName === TRACK_NAMES . DATA_SCIENCE &&
18311830 row . typeName === TYPE_NAMES . MARATHON_MATCH
1832- const hasHistoryData = ! _ . isNil ( row . newRating ) ||
1833- ! _ . isNil ( row . oldRating ) ||
1834- ! _ . isNil ( row . placement ) ||
1835- ! _ . isNil ( row . percentile ) ||
1836- ! _ . isNil ( row . newVolatility ) ||
1837- ! _ . isNil ( row . oldVolatility )
1838-
1839- return ! ( isMarathonHistory && isLegacyNumericChallenge && ! row . challengeName && ! hasHistoryData )
1831+
1832+ return ! ( isMarathonHistory && isLegacyNumericChallenge && ! row . challengeName )
18401833 } )
18411834}
18421835
@@ -2713,7 +2706,7 @@ async function getHistoryStats (currentUser, handle, query) {
27132706 unresolvedPairKeys = getUnresolvedHistoryPairKeys ( unresolvedPairKeys , legacyCodeFallbackRows )
27142707 }
27152708
2716- annotatedRows = filterEmptyUnresolvedLegacyMarathonHistoryRows ( annotatedRows )
2709+ annotatedRows = filterUnresolvedLegacyMarathonHistoryRows ( annotatedRows )
27172710
27182711 const orderedRows = orderUnifiedHistoryRows ( recomputeUnifiedHistoryMostRecentFlags ( annotatedRows ) )
27192712 if ( orderedRows . length > 0 ) {
0 commit comments