Skip to content

Commit 8a992cb

Browse files
authored
Merge branch 'master' into dependabot/npm_and_yarn/countly-sdk-nodejs-24.10.1
2 parents 68e6e55 + 51bd944 commit 8a992cb

File tree

6 files changed

+45
-15
lines changed

6 files changed

+45
-15
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## Version xx.xx.xx
2+
3+
Dependencies:
4+
- Bump sass from 1.81.0 to 1.83.1
5+
16
## Version 24.05.20
27
Fixes:
38
- [push] Fixed bug where IOS credentials get mixed up while sending messages from different apps at the same time

api/utils/common.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,13 @@ common.getDate = function(timestamp, timezone) {
693693
* @returns {number} current day of the year
694694
*/
695695
common.getDOY = function(timestamp, timezone) {
696-
var endDate = (timestamp) ? moment.unix(timestamp * 1000) : moment();
696+
var endDate;
697+
if (timestamp && timestamp.toString().length === 13) {
698+
endDate = (timestamp) ? moment.unix(timestamp / 1000) : moment();
699+
}
700+
else {
701+
endDate = (timestamp) ? moment.unix(timestamp) : moment();
702+
}
697703

698704
if (timezone) {
699705
endDate.tz(timezone);

package-lock.json

+4-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
"offline-geocoder": "git+https://github.com/Countly/offline-geocoder.git",
8282
"properties-parser": "0.6.0",
8383
"puppeteer": "^23.8.0",
84-
"sass": "1.81.0",
84+
"sass": "1.83.1",
8585
"tslib": "^2.6.3",
8686
"uglify-js": "3.19.3",
8787
"underscore": "1.13.7",

plugins/system-utility/api/system.utility.js

+17-7
Original file line numberDiff line numberDiff line change
@@ -471,13 +471,23 @@ async function stopProfiler(processName) {
471471
const errors = [];
472472

473473
// clear old files
474-
await new Promise(
475-
(res, rej) => countlyFs.gridfs.deleteAll(
476-
PROFILER_DIR,
477-
null,
478-
err => err ? rej(err) : res()
479-
)
480-
);
474+
try {
475+
await new Promise(
476+
(res, rej) => countlyFs.gridfs.deleteAll(
477+
PROFILER_DIR,
478+
null,
479+
err => err ? rej(err) : res()
480+
)
481+
);
482+
}
483+
catch (err) {
484+
if (err.code === 26) { // NamespaceNotFound: thrown when there's no collection initially
485+
// do nothing...
486+
}
487+
else {
488+
throw err;
489+
}
490+
}
481491

482492
// coverage
483493
try {

plugins/views/tests.js

+11-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ tableResponse["30days"] = {"iTotalRecords": 0, "iTotalDisplayRecords": 0, "aaDat
2929
tableResponse["7days"] = {"iTotalRecords": 0, "iTotalDisplayRecords": 0, "aaData": [{"u": 0, "t": 0, "s": 0, "b": 0, "e": 0, "d-calc": 0, "d": 0, "n": 0, "scr-calc": 0, "scr": 0, "uvalue": 0}]};
3030
tableResponse.month = {"iTotalRecords": 0, "iTotalDisplayRecords": 0, "aaData": [{"u": 0, "t": 0, "s": 0, "b": 0, "e": 0, "d-calc": 0, "d": 0, "n": 0, "scr-calc": 0, "scr": 0, "uvalue": 0}]}; //this year
3131

32+
var userHistory = {};
3233

3334
graphResponse.hour = {};
3435
graphResponse.yesterday = {};
@@ -277,11 +278,14 @@ describe('Testing views plugin', function() {
277278
tableResponse["30days"].iTotalRecords += 1;
278279
tableResponse["30days"].iTotalDisplayRecords += 1;
279280
pushValues("30days", 0, {"u": 1, "t": 1, "s": 1, "uvalue": 1, "n": 1, "view": "testview0"});
281+
userHistory["user1"] = {};
282+
userHistory["user1"]["30days"] = true;
280283

281284
if (days_this_year > 25) {
282285
tableResponse.month.iTotalRecords += 1;
283286
tableResponse.month.iTotalDisplayRecords += 1;
284287
pushValues("month", 0, {"t": 1, "s": 1, "uvalue": 1, "u": 1, "n": 1, "view": "testview0"});
288+
userHistory["user1"]["month"] = true;
285289
}
286290
/* else {
287291
tableResponse.month.iTotalRecords = 0;
@@ -321,7 +325,13 @@ describe('Testing views plugin', function() {
321325
if (days_this_year > 1) {
322326
tableResponse.month.iTotalRecords = 1;
323327
tableResponse.month.iTotalDisplayRecords = 1;
324-
pushValues("month", 0, {"t": 1, "s": 1});
328+
if (userHistory["user1"]["month"]) {
329+
pushValues("month", 0, {"t": 1, "s": 1});
330+
}
331+
else {
332+
pushValues("month", 0, {"u": 1, "uvalue": 1, "t": 1, "s": 1, "view": "testview0"});
333+
userHistory["user1"]["month"] = true;
334+
}
325335
//tableResponse["month"]['aaData'][0]['n']=1;
326336
tableResponse.month.aaData[0].uvalue = 1;
327337
}

0 commit comments

Comments
 (0)