Skip to content

Commit 32b326f

Browse files
committed
Merge branch 'master' into next
2 parents 079cbc2 + a6fe336 commit 32b326f

3 files changed

Lines changed: 19 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## Version 25.03.X
2+
Fixes:
3+
- [core] Fix period calculation
4+
15
## Version 25.03.33
26
Fixes:
37
- [compliance-hub] Correctly merge user history on user merge

api/lib/countly.common.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ function getUniqArray(weeksArray_pd, weekCounts_pd, monthsArray_pd, monthCounts_
107107

108108
if (weekCounts[key] < 7) {
109109
for (i = 0; i < weeksArray.length; i++) {
110-
weeksArray[i] = weeksArray[i].replace(key, 0);
110+
if (weeksArray[i] === key) {
111+
weeksArray[i] = '0';
112+
}
111113
}
112114
}
113115
}
@@ -126,7 +128,9 @@ function getUniqArray(weeksArray_pd, weekCounts_pd, monthsArray_pd, monthCounts_
126128

127129
if (monthCounts[key] < tmpDaysInMonth) {
128130
for (i = 0; i < monthsArray.length; i++) {
129-
monthsArray[i] = monthsArray[i].replace(key, 0);
131+
if (monthsArray[i] === key) {
132+
monthsArray[i] = '0';
133+
}
130134
}
131135
}
132136
}
@@ -226,7 +230,9 @@ function getUniqCheckArray(weeksArray_pd, weekCounts_pd, monthsArray_pd, monthCo
226230

227231
if (weekCounts[key] < 1) {
228232
for (i = 0; i < weeksArray.length; i++) {
229-
weeksArray[i] = weeksArray[i].replace(key, 0);
233+
if (weeksArray[i] === key) {
234+
weeksArray[i] = '0';
235+
}
230236
}
231237
}
232238
}
@@ -245,7 +251,9 @@ function getUniqCheckArray(weeksArray_pd, weekCounts_pd, monthsArray_pd, monthCo
245251

246252
if (monthCounts[key] < (tmpDaysInMonth * 0.5)) {
247253
for (i = 0; i < monthsArray.length; i++) {
248-
monthsArray[i] = monthsArray[i].replace(key, 0);
254+
if (monthsArray[i] === key) {
255+
monthsArray[i] = '0';
256+
}
249257
}
250258
}
251259
}

bin/scripts/sharding/sharding.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ check.forEach(function(c) {
5858
var exceptional = true;
5959
var db = clyCollections.indexOf(c) === -1 ? drill : cly,
6060
dbName = clyCollections.indexOf(c) === -1 ? COUNTLY_DRILL : COUNTLY,
61-
count = db[c].count(),
62-
capped = db[c].stats()['capped'];
63-
61+
//count = db[c].count(), -- This is deprecated in mongo version >6
62+
count = db[c].countDocuments({});
63+
var capped = db[c].stats()['capped'];
6464
COUNTLY_TO_SHARD.some((e) => {
6565
if (c.indexOf(e) == 0) {
6666
exceptional = false;

0 commit comments

Comments
 (0)