Skip to content

Commit

Permalink
Merge pull request #5289 from Cookiezaurs/master
Browse files Browse the repository at this point in the history
[bugfix] [core] Correctly validate if we have to increase unique user count for sessions in aggregated data
  • Loading branch information
Cookiezaurs authored May 29, 2024
2 parents bb1b58b + 14ecc97 commit 59c9403
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/parts/data/usage.js
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ function processUserSession(dbAppUser, params, done) {
uniqueLevelsMonth.push(params.time.day);
}

if (userLastSeenDate.year() === params.time.yearly &&
if ((userLastSeenDate.year() + "") === (params.time.yearly + "") &&
Math.ceil(userLastSeenDate.format("DDD") / 7) < params.time.weekly) {
uniqueLevels[uniqueLevels.length] = params.time.yearly + ".w" + params.time.weekly;
uniqueLevelsZero.push("w" + params.time.weekly);
Expand Down
2 changes: 1 addition & 1 deletion plugins/views/api/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -2192,7 +2192,7 @@ const escapedViewSegments = { "name": true, "segment": true, "height": true, "wi
if (lastViewTimestamp < (params.time.timestamp - secInHour)) {
tmpTimeObjMonth['d.' + params.time.day + '.' + escapedMetricVal + common.dbMap.unique] = 1;
}
if (lastViewDate.year() === params.time.yearly && lastMoment.isoWeek() < params.time.weeklyISO) {
if ((lastViewDate.year() + "") === (params.time.yearly + "") && lastMoment.isoWeek() < params.time.weeklyISO) {
tmpTimeObjZero["d.w" + params.time.weeklyISO + '.' + escapedMetricVal + common.dbMap.unique] = 1;
}

Expand Down

0 comments on commit 59c9403

Please sign in to comment.