Skip to content

Commit 59c9403

Browse files
authored
Merge pull request #5289 from Cookiezaurs/master
[bugfix] [core] Correctly validate if we have to increase unique user count for sessions in aggregated data
2 parents bb1b58b + 14ecc97 commit 59c9403

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

api/parts/data/usage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ function processUserSession(dbAppUser, params, done) {
553553
uniqueLevelsMonth.push(params.time.day);
554554
}
555555

556-
if (userLastSeenDate.year() === params.time.yearly &&
556+
if ((userLastSeenDate.year() + "") === (params.time.yearly + "") &&
557557
Math.ceil(userLastSeenDate.format("DDD") / 7) < params.time.weekly) {
558558
uniqueLevels[uniqueLevels.length] = params.time.yearly + ".w" + params.time.weekly;
559559
uniqueLevelsZero.push("w" + params.time.weekly);

plugins/views/api/api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2192,7 +2192,7 @@ const escapedViewSegments = { "name": true, "segment": true, "height": true, "wi
21922192
if (lastViewTimestamp < (params.time.timestamp - secInHour)) {
21932193
tmpTimeObjMonth['d.' + params.time.day + '.' + escapedMetricVal + common.dbMap.unique] = 1;
21942194
}
2195-
if (lastViewDate.year() === params.time.yearly && lastMoment.isoWeek() < params.time.weeklyISO) {
2195+
if ((lastViewDate.year() + "") === (params.time.yearly + "") && lastMoment.isoWeek() < params.time.weeklyISO) {
21962196
tmpTimeObjZero["d.w" + params.time.weeklyISO + '.' + escapedMetricVal + common.dbMap.unique] = 1;
21972197
}
21982198

0 commit comments

Comments
 (0)