Skip to content

Commit 391bbb8

Browse files
authored
Merge branch 'develop' into PM-5396
2 parents cb05877 + af1b781 commit 391bbb8

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

src/services/StatisticsService.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1277,6 +1277,21 @@ function filterUnifiedHistoryRowsToCompletedChallenges (rows, challengeMetadataB
12771277
})
12781278
}
12791279

1280+
/**
1281+
* Check whether a history row belongs to a configured rating path.
1282+
* Rating-path rows intentionally keep their stored type even when the source
1283+
* challenge was a native Challenge or Marathon Match event.
1284+
* @param {Object} row unified history row annotated with stored track/type names
1285+
* @returns {boolean} true when the row should preserve its stored rating-path dimensions
1286+
*/
1287+
function isConfiguredRatingPathHistoryRow (row) {
1288+
return !!(
1289+
getConfiguredRatingPath(config.RATING_PATHS, row && row.typeName) ||
1290+
getConfiguredRatingPath(config.RATING_PATHS, row && row.typeId) ||
1291+
getConfiguredRatingPathByTypeId(config.RATING_PATHS, row && row.typeId)
1292+
)
1293+
}
1294+
12801295
/**
12811296
* Attach canonical challenge ids and names to unified history rows before shaping
12821297
* the response payload consumed by the profiles UI.
@@ -1304,7 +1319,7 @@ function enrichUnifiedHistoryRowsWithChallengeMetadata (rows, challengeMetadataB
13041319
: _.get(challenge, 'legacyRecord.legacySystemId')
13051320
)
13061321
const preserveLegacyChallengeId = isLegacyNumericMarathonHistoryRow(row)
1307-
const dimension = challenge.trackId && challenge.typeId
1322+
const dimension = !isConfiguredRatingPathHistoryRow(row) && challenge.trackId && challenge.typeId
13081323
? resolveStatsDimensionForChallengeRow({
13091324
trackId: String(challenge.trackId),
13101325
typeId: String(challenge.typeId)

0 commit comments

Comments
 (0)