Skip to content

Commit 5aee986

Browse files
authored
Merge branch 'next' into eslint-remove-no-console
2 parents c6b1b63 + 7a79ddd commit 5aee986

File tree

121 files changed

+29961
-1055
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+29961
-1055
lines changed

.eslintrc.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
},
136136
"env": {
137137
"browser": true,
138-
"es6": true
138+
"es2020": true
139139
},
140140
"rules": {
141141
"valid-jsdoc": [
@@ -208,7 +208,7 @@
208208
],
209209
"excludedFiles": "plugins/*/frontend/public/**/*.js",
210210
"env": {
211-
"es6": true,
211+
"es2020": true,
212212
"node": true
213213
},
214214
"parserOptions": {
@@ -285,7 +285,7 @@
285285
],
286286
"excludedFiles": "plugins/*/tests.js",
287287
"env": {
288-
"es6": true,
288+
"es2020": true,
289289
"node": true
290290
},
291291
"parserOptions": {
@@ -302,7 +302,7 @@
302302
"plugins/*/tests.js"
303303
],
304304
"env": {
305-
"es6": true,
305+
"es2020": true,
306306
"node": true,
307307
"mocha": true
308308
},
@@ -321,7 +321,7 @@
321321
"ui-tests/**/*.js"
322322
],
323323
"env": {
324-
"es6": true,
324+
"es2020": true,
325325
"node": true,
326326
"mocha": true
327327
},

.github/workflows/main.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464

6565
services:
6666
mongodb:
67-
image: mongo:6.0
67+
image: mongo:7.0
6868
options: >-
6969
--health-cmd mongosh
7070
--health-interval 10s
@@ -121,7 +121,7 @@ jobs:
121121

122122
services:
123123
mongodb:
124-
image: mongo:6.0
124+
image: mongo:7.0
125125
options: >-
126126
--health-cmd mongosh
127127
--health-interval 10s
@@ -168,7 +168,7 @@ jobs:
168168

169169
services:
170170
mongodb:
171-
image: mongo:6.0
171+
image: mongo:7.0
172172
options: >-
173173
--health-cmd mongosh
174174
--health-interval 10s
@@ -221,7 +221,7 @@ jobs:
221221

222222
services:
223223
mongodb:
224-
image: mongo:6.0
224+
image: mongo:7.0
225225
options: >-
226226
--health-cmd mongosh
227227
--health-interval 10s

CHANGELOG.md

+53
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,56 @@
1+
## Version 24.05.1
2+
Fixes:
3+
- [populator] Bugfix for - Can't edit populator template
4+
- [surveys] fix nps/survey background color
5+
- [alerts] fix for old data remains when the alerts metric is updated
6+
- [star-rating] tooltips updates
7+
- [populator] fix for correctly checking if different plugins enabled
8+
9+
Enterprise fixes:
10+
- [formulas] null checks
11+
- [surveys] survey/nps tooltips updates
12+
- [surveys] fix for nps/survey color hover
13+
- [surveys] Fix submit button
14+
- [users] add hinge back in user
15+
16+
## Version 24.05
17+
Features:
18+
- [alerts] Alerts plugin revamp
19+
- [core] Ensure consistency when deleting dashboard user
20+
- [crashes] Contains operator for (App Version) filter on the Crash Overview page
21+
- [crashes] Sort crashes by filtered results
22+
- [dashboard] Show in UI which values are estimated
23+
- [dashboards] Improve dashboard list loading time
24+
- [data-manager] Add option to delete source events when merging
25+
- [date-picker] Date picker presets
26+
- [dev] Remote process profiling option
27+
- [events] Ensure consistency when deleting an event
28+
- [plugins] Dynamic plugins including docker
29+
- [populator] Crash and Symbolication examples
30+
- [populator] New Data Populator
31+
- [push] Move to new FCM API
32+
- [versions] View to display history of upgrades for server
33+
- [views] Visualize omitted views just like we visualize omited events in events section
34+
35+
Enterprise Features:
36+
- [data-manager] Delete user property value
37+
- [data-manager] Transformation to copy event segmentation to user custom properties
38+
- [date-picker] Add "hours" and "minutes" options to "in the last" filtering
39+
- [flows] Allow disabling flows
40+
- [flows] Merge Flow plugin collections into single one
41+
- [license] Improve license emails
42+
- [surveys] Add "Internal Label" field to Surveys and Ratings
43+
- [surveys] Add custom properties to surveys
44+
- [surveys] Add optional ToC and Privacy Policy checkbox with URLs to feedback widgets
45+
- [surveys] Faster table loading through server side tables
46+
- [surveys] Removing connect.sid cookie in case of nps
47+
- [surveys] Responsiveness for survey/NPS/rating widget contents
48+
- [users] Profile Groups
49+
- [users] Purging user profiles in bulk
50+
- [users] Record hinge as user property
51+
- [users] Select/deselect users
52+
- [users] User Profiles widget in dashboards
53+
154
## Version 23.11.22
255
Features:
356
- [views] Added deselect All button

Gruntfile.js

+20-2
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,16 @@ module.exports = function(grunt) {
327327
grunt.registerTask('dist', ['sass', 'concat', 'uglify', 'cssmin']);
328328

329329
grunt.registerTask('plugins', 'Minify plugin JS / CSS files and copy images', function() {
330-
var plugins = require('./plugins/plugins.json'), js = [], css = [], img = [], fs = require('fs'), path = require('path');
330+
var js = [], css = [], img = [], fs = require('fs'), path = require('path');
331+
332+
var pluginFolderPath = path.join(__dirname, 'plugins');
333+
//read all folder names
334+
var plugins = fs.readdirSync(pluginFolderPath);
335+
//filter out only folders
336+
plugins = plugins.filter(function(file) {
337+
return fs.statSync(path.join(pluginFolderPath, file)).isDirectory();
338+
});
339+
331340
console.log('Preparing production files for following plugins: %j', plugins);
332341

333342
if (plugins.indexOf('drill') !== -1 && plugins.indexOf('users') !== -1 && plugins.indexOf('push') !== -1) {
@@ -438,7 +447,16 @@ module.exports = function(grunt) {
438447
});
439448

440449
grunt.registerTask('locales', 'Concat all locale files into one', function() {
441-
var plugins = require('./plugins/plugins.json'), locales = {}, fs = require('fs'), path = require('path');
450+
var locales = {}, fs = require('fs'), path = require('path');
451+
452+
var pluginFolderPath = path.join(__dirname, 'plugins');
453+
//read all folder names
454+
var plugins = fs.readdirSync(pluginFolderPath);
455+
//filter out only folders
456+
plugins = plugins.filter(function(file) {
457+
return fs.statSync(path.join(pluginFolderPath, file)).isDirectory();
458+
});
459+
442460
console.log('Preparing locale files for core & plugins: %j', plugins);
443461

444462
var pushLocaleFile = function(name, path) {

api/api.js

100755100644
+2-2
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,9 @@ plugins.connectToAllDatabases().then(function() {
156156
console.log("Successfully stored batch state");
157157
}
158158
catch (ex) {
159-
console.log("Could not store batch state");
159+
console.log("Could not store batch state", ex);
160160
}
161-
process.exit(code);
161+
process.exit(typeof code === "number" ? code : 1);
162162
}
163163

164164
/**

api/parts/data/usage.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ function processUserSession(dbAppUser, params, done) {
545545
uniqueLevelsMonth.push(params.time.day);
546546
}
547547

548-
if (userLastSeenDate.year() === params.time.yearly &&
548+
if ((userLastSeenDate.year() + "") === (params.time.yearly + "") &&
549549
Math.ceil(userLastSeenDate.format("DDD") / 7) < params.time.weekly) {
550550
uniqueLevels[uniqueLevels.length] = params.time.yearly + ".w" + params.time.weekly;
551551
uniqueLevelsZero.push("w" + params.time.weekly);

api/utils/common.js

+12-5
Original file line numberDiff line numberDiff line change
@@ -2773,13 +2773,19 @@ common.updateAppUser = function(params, update, no_meta, callback) {
27732773
* @param {object} metrics - metrics object from SDK request
27742774
*/
27752775
common.processCarrier = function(metrics) {
2776-
if (metrics && metrics._carrier) {
2776+
// Initialize metrics if undefined
2777+
metrics = metrics || {};
2778+
if (metrics._carrier) {
27772779
var carrier = metrics._carrier + "";
27782780

27792781
//random hash without spaces
2780-
if (carrier.length === 16 && carrier.indexOf(" ") === -1) {
2782+
if ((carrier.length === 16 && carrier.indexOf(" ") === -1)) {
2783+
delete metrics._carrier;
2784+
}
2785+
2786+
// Since iOS 16.04 carrier returns value "--", interpret as Unknown by deleting
2787+
if (carrier === "--") {
27812788
delete metrics._carrier;
2782-
return;
27832789
}
27842790

27852791
//random code
@@ -2791,15 +2797,16 @@ common.processCarrier = function(metrics) {
27912797
}
27922798
else {
27932799
delete metrics._carrier;
2794-
return;
27952800
}
27962801
}
27972802

27982803
carrier = carrier.replace(/\w\S*/g, function(txt) {
27992804
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
28002805
});
2806+
28012807
metrics._carrier = carrier;
28022808
}
2809+
metrics._carrier = metrics._carrier ? metrics._carrier : "Unknown";
28032810
};
28042811

28052812
/**
@@ -3817,4 +3824,4 @@ common.trimWhitespaceStartEnd = function(value) {
38173824
return value;
38183825
};
38193826

3820-
module.exports = common;
3827+
module.exports = common;

api/utils/taskmanager.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -956,15 +956,19 @@ taskmanager.rerunTask = function(options, callback) {
956956
errored: true,
957957
request: reqData
958958
}, body);
959-
960959
}
961960
}
961+
if (options.autoUpdate) { //as it is auto from task, do callback only after finishing calculations.
962+
callback1(null, "Success");
963+
}
962964
}
963965
};
964966
if (common.processRequest) {
965967
common.processRequest(params);
966968
}
967-
callback1(null, "Success");
969+
if (!options.autoUpdate) {
970+
callback1(null, "Success");
971+
}
968972
});
969973
}
970974

bin/commands/countly.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ countly_upgrade (){
111111
countly_root ;
112112
if [ $# -eq 0 ]
113113
then
114-
INOFFLINEMODE=$(countly config 'api.offline_mode' | awk -F'= ' '{print $2}')
114+
INOFFLINEMODE=$(countly config 'api.offline_mode' | awk '/=/{print $NF}')
115115

116116
if [ "$INOFFLINEMODE" == "false" ]
117117
then

bin/countly.install_rhel.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ sudo dnf install -y alsa-lib.x86_64 atk.x86_64 cups-libs.x86_64 gtk3.x86_64 libX
6060
sudo dnf update -y nss
6161

6262
#install nodejs
63-
sudo dnf module install -y nodejs:18/common
63+
sudo dnf module install -y nodejs:20/common
6464

6565
set +e
6666
NODE_JS_CMD=$(which nodejs)
@@ -87,7 +87,7 @@ sudo systemctl start sendmail > /dev/null || echo "sendmail service does not exi
8787

8888
#install npm modules
8989
npm config set prefix "$DIR/../.local/"
90-
( cd "$DIR/.."; npm install -g [email protected]; npm install sqlite3 --build-from-source; npm install; npm install argon2 --build-from-source; )
90+
( cd "$DIR/.."; npm install argon2; npm install sqlite3 --build-from-source; npm install; )
9191

9292
#install numactl
9393
sudo dnf install -y numactl

bin/countly.install_ubuntu.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ sudo apt-get update
5858
sudo apt-get install -y ca-certificates curl gnupg
5959
sudo mkdir -p /etc/apt/keyrings
6060
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
61-
NODE_MAJOR=18
61+
NODE_MAJOR=20
6262
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
6363
sudo apt-get update
6464
sudo apt-get install nodejs -y
@@ -91,7 +91,7 @@ sudo apt-get install -y sendmail
9191

9292
#install npm modules
9393
npm config set prefix "$DIR/../.local/"
94-
( cd "$DIR/.."; npm install -g [email protected]; npm install sqlite3 --build-from-source; npm install; npm install argon2 --build-from-source; )
94+
( cd "$DIR/.."; npm install argon2; npm install sqlite3 --build-from-source; npm install; )
9595

9696
#install mongodb
9797
if ! command -v mongod &> /dev/null; then
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/**
2+
* Script to add no_snapshots flag to drill reports
3+
* Server: countly
4+
* Path: $(countly dir)/bin/scripts/reports_snapshot_flag.js
5+
* Command: node fix_null_uids.js
6+
*/
7+
const pluginManager = require('../../../plugins/pluginManager.js');
8+
var Promise = require("bluebird");
9+
10+
console.log('looking for byval reports');
11+
12+
13+
Promise.all([pluginManager.dbConnection("countly")]).then(async function([countlyDb]) {
14+
countlyDb.collection('long_tasks').find({"type": "drill", "linked_to._issuer": "wqm:drill", "manually_create": true}).toArray(function(err, reports) {
15+
if (err) {
16+
console.log('Error while fetching reports', err);
17+
countlyDb.close();
18+
return;
19+
}
20+
else {
21+
console.log("checking reports");
22+
reports = reports || [];
23+
Promise.each(reports, function(report) {
24+
return new Promise(function(resolve, reject) {
25+
26+
try {
27+
report.request = JSON.parse(report.request);
28+
if (report.request && report.request.json && report.request.json.method === "segmentation" && report.request.json.projectionKey && !report.request.json.no_snapshots) {
29+
report.request.json.no_snapshots = true;
30+
countlyDb.collection('long_tasks').updateOne({_id: report._id}, {$set: {"request": JSON.stringify(report.request)}}, function(err) {
31+
if (err) {
32+
console.log('Error while updating report', report._id);
33+
reject();
34+
}
35+
else {
36+
console.log('report updated', report._id);
37+
resolve();
38+
}
39+
});
40+
}
41+
else {
42+
resolve();
43+
}
44+
}
45+
catch (e) {
46+
console.log('Error while parsing report', report._id);
47+
console.log(e);
48+
resolve();
49+
}
50+
});
51+
}).then(function() {
52+
console.log('Finished');
53+
countlyDb.close();
54+
process.exit();
55+
}).catch(function(err) {
56+
console.log('Error', err);
57+
countlyDb.close();
58+
process.exit();
59+
});
60+
}
61+
});
62+
});

bin/scripts/mongodb.install.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -341,12 +341,12 @@ if [ $# -eq 0 ]; then
341341
exit 1
342342
fi
343343

344-
echo "[mongodb-org-6.0]
344+
echo "[mongodb-org-7.0]
345345
name=MongoDB Repository
346-
baseurl=https://repo.mongodb.org/yum/redhat/${CENTOS_MAJOR}/mongodb-org/6.0/x86_64/
346+
baseurl=https://repo.mongodb.org/yum/redhat/${CENTOS_MAJOR}/mongodb-org/7.0/x86_64/
347347
gpgcheck=1
348348
enabled=1
349-
gpgkey=https://www.mongodb.org/static/pgp/server-6.0.asc" > /etc/yum.repos.d/mongodb-org-6.0.repo
349+
gpgkey=https://www.mongodb.org/static/pgp/server-7.0.asc" > /etc/yum.repos.d/mongodb-org-7.0.repo
350350

351351
yum install -y mongodb-org
352352
elif [ -f /etc/lsb-release ]; then
@@ -359,8 +359,8 @@ gpgkey=https://www.mongodb.org/static/pgp/server-6.0.asc" > /etc/yum.repos.d/mon
359359
exit 1
360360
fi
361361

362-
wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add -
363-
echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu ${UBUNTU_RELEASE}/mongodb-org/6.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-6.0.list ;
362+
wget -qO - https://www.mongodb.org/static/pgp/server-7.0.asc | sudo apt-key add -
363+
echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu ${UBUNTU_RELEASE}/mongodb-org/7.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-7.0.list ;
364364
apt-get update
365365
DEBIAN_FRONTEND="noninteractive" apt-get install -y mongodb-org || (echo "Failed to install mongodb." ; exit)
366366
else

0 commit comments

Comments
 (0)