Skip to content

Commit 33d1a1d

Browse files
authored
Merge branch 'next' into rc-command
2 parents 4f0d559 + ee10275 commit 33d1a1d

File tree

13 files changed

+160
-169
lines changed

13 files changed

+160
-169
lines changed

.github/workflows/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ name: CI
66
on:
77
# Triggers the workflow on push or pull request events but only for the master branch
88
pull_request:
9-
branches: [ master, next ]
9+
branches: [ master, next, release.24.10 ]
1010

1111
# Allows you to run this workflow manually from the Actions tab
1212
workflow_dispatch:

CHANGELOG.md

+38-32
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,41 @@
1+
## Version 24.10.2
2+
Fixes:
3+
- [core] Correct aggregated collection cleanup on event omitting
4+
- [core] Fixed bug where changing passwords results in the loss of the "Global Admin" role
5+
- [core] Fixed bug where exporting incoming data logs could result in "Incorrect parameter \"data\" error
6+
- [core] Removed use of commands which needs admin rights from report manager.
7+
- [crash] Fixed bug in crash ingestion for scenarios where the "app version" is not a string.
8+
- [script] Fixing bug with "delete_old_members" script that led to malformed requests
9+
10+
Enterprise fixes:
11+
- [nps] Fixed bug that showed the wrong nps preview title
12+
113
## Version 24.10.1
2-
Integrating 24.05.16 fixes
14+
Fixes:
15+
- [core] Replaced "Users" with "Sessions" label on technology home widgets
16+
- [push] Improved ability to observe push related errors
17+
- [push] Replaced push plugin with an earlier version of the plugin
18+
19+
Enterprise fixes:
20+
- [cohorts] Fixed issues with nightly cleanup
21+
- [data-manager] Fixed UI bug where rules were not visible when editing "Merge by regex" transformations
22+
- [drill] Fixed wrong pie chart label tooltip in dashboard widget
23+
- [flows] Fixed bug in case of null data in schema
24+
- [license] Fixed bug with MAU type of licenses that would prevent the server from starting
25+
- [nps] Fixed bug in the editor where the "internal name" field was not mandatory
26+
- [nps] Fixed bug where it was possible to submit empty nps surveys
27+
- [ratings] Fixed bug with user consent
28+
- [ratings] Fixed UI bug where "Internal name" was not a mandatory field
29+
30+
Security:
31+
- Bumped cookie-parser from 1.4.6 to 1.4.7
32+
- Bumped express-rate-limit from 7.4.0 to 7.4.1
33+
- Bumped moment-timezone from 0.5.45 to 0.5.46
34+
- Bumped sass from 1.79.3 to 1.79.4
35+
- Fixing minor vulnerability that would allow for unauthorized file upload
36+
37+
Enterprise Features:
38+
- [block] Added a way to filter crashes by their error (stacktrace)
339

440
## Version 24.10
541
Fixes:
@@ -35,39 +71,9 @@ Enterprise Features:
3571
- [users] UI improvements
3672
- [views] Added a quick transition to drill
3773

38-
## Version 24.05.17
39-
Fixes:
40-
- [push] Improved ability to observe push related errors
41-
42-
Enterprise fixes:
43-
- [cohorts] Fixed issues with nightly cleanup
44-
- [data-manager] Fixed UI bug where rules were not visible when editing "Merge by regex" transformations
45-
- [drill] Fixed wrong pie chart label tooltip in dashboard widget
46-
- [flows] Fixed bug in case of null data in schema
47-
- [nps] Fixed bug in the editor where the "internal name" field was not mandatory
48-
- [ratings] Fixed UI bug where "Internal name" was not a mandatory field
49-
50-
Security:
51-
- Fixing minor vulnerability that would allow for unauthorized file upload
52-
53-
## Version 24.05.16
54-
Fixes:
55-
- [core] Replaced "Users" with "Sessions" label on technology home widgets
56-
- [push] Replaced push plugin with an earlier version of the plugin
57-
58-
Enterprise fixes:
59-
- [license] Fixed bug with MAU type of licenses that would prevent the server from starting
60-
- [nps] Fixed bug where it was possible to submit empty nps surveys
61-
- [ratings] Fixed bug with user consent
62-
63-
Security:
64-
- Bumped cookie-parser from 1.4.6 to 1.4.7
65-
- Bumped express-rate-limit from 7.4.0 to 7.4.1
66-
- Bumped moment-timezone from 0.5.45 to 0.5.46
67-
- Bumped sass from 1.79.3 to 1.79.4
68-
6974
## Version 24.05.15
7075
Enterprise fixes:
76+
- [ab-testing] Fixed JSON.parse issue preventing creation of AB tests
7177
- [nps] Fixed UI issues in the widget editor related to the "user consent" section
7278
- [ratings] Fixed rendering issue for escaped values
7379

api/utils/requestProcessor.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -1183,7 +1183,7 @@ const processRequest = (params) => {
11831183
return new Promise(function(resolve) {
11841184
var collectionNameWoPrefix = common.crypto.createHash('sha1').update(obj.key + params.qstring.app_id).digest('hex');
11851185
//removes all document for current segment
1186-
common.db.collection("events" + collectionNameWoPrefix).remove({"s": {$in: obj.list}}, {multi: true}, function(err3) {
1186+
common.db.collection("events_data").remove({"_id": {"$regex": ("^" + params.qstring.app_id + "_" + collectionNameWoPrefix + "_.*")}, "s": {$in: obj.list}}, {multi: true}, function(err3) {
11871187
if (err3) {
11881188
console.log(err3);
11891189
}
@@ -1198,7 +1198,7 @@ const processRequest = (params) => {
11981198
unsetUs["meta_v2." + obj.list[p]] = "";
11991199
}
12001200
//clears out meta data for segments
1201-
common.db.collection("events" + collectionNameWoPrefix).update({$or: my_query}, {$unset: unsetUs}, {multi: true}, function(err4) {
1201+
common.db.collection("events_data").update({"_id": {"$regex": ("^" + params.qstring.app_id + "_" + collectionNameWoPrefix + "_.*")}, $or: my_query}, {$unset: unsetUs}, {multi: true}, function(err4) {
12021202
if (err4) {
12031203
console.log(err4);
12041204
}
@@ -1242,7 +1242,6 @@ const processRequest = (params) => {
12421242
else {
12431243
resolve();
12441244
}
1245-
12461245
});
12471246
}
12481247
else {

api/utils/taskmanager.js

+2-116
Original file line numberDiff line numberDiff line change
@@ -66,80 +66,6 @@ taskmanager.longtask = function(options) {
6666
var start = new Date().getTime();
6767
var timeout;
6868

69-
var saveOpId = async function(comment_id, retryCount) {
70-
common.db.admin().command({ currentOp: 1 }, async function(error, result) {
71-
if (error) {
72-
log.d(error);
73-
return;
74-
}
75-
else {
76-
if (result && result.inprog) {
77-
for (var i = 0; i < result.inprog.length; i++) {
78-
let op = result.inprog[i];
79-
if (!('$truncated' in op.command) && (i !== result.inprog.length - 1)) {
80-
continue;
81-
}
82-
if (!('$truncated' in op.command) && (i === result.inprog.length - 1)) {
83-
if (retryCount < 3) {
84-
setTimeout(() => saveOpId(comment_id, (++retryCount)), 500);
85-
return;
86-
}
87-
else {
88-
log.d(`operation not found for task:${options.id} comment: ${comment_id}`);
89-
break;
90-
}
91-
}
92-
93-
let comment_position = op.command.$truncated.indexOf('$comment');
94-
if (comment_position === -1) {
95-
continue;
96-
}
97-
98-
let substr = op.command.$truncated.substring(comment_position, op.command.$truncated.length) || "";
99-
var comment_val = "";
100-
substr = substr.match(/"(.*?)"/);
101-
if (substr && Array.isArray(substr)) {
102-
comment_val = substr[1];
103-
}
104-
105-
if (comment_val === comment_id) {
106-
var task_id = options.id;
107-
var op_id = op.opid;
108-
await common.db.collection("long_tasks").findOneAndUpdate({ _id: common.db.ObjectID(task_id) }, { $set: { op_id: op_id } });
109-
log.d(`Operation found task: ${task_id} op:${op_id} comment: ${comment_id}`);
110-
break;
111-
}
112-
else if ((comment_val !== comment_id) && (i === (result.inprog.length - 1))) {
113-
if (retryCount < 3) {
114-
setTimeout(() => saveOpId(comment_id, (++retryCount)), 500);
115-
break;
116-
}
117-
else {
118-
log.d(`operation not found for task:${options.id} comment: ${comment_id}`);
119-
break;
120-
}
121-
}
122-
}
123-
}
124-
}
125-
});
126-
};
127-
128-
if (options.comment_id) {
129-
var retryCount = 0;
130-
try {
131-
saveOpId(options.comment_id, retryCount);
132-
}
133-
catch (err) {
134-
if (retryCount < 3) {
135-
setTimeout(() =>saveOpId(options.comment_id, ++retryCount), 500);
136-
}
137-
else {
138-
console.log(err);
139-
}
140-
}
141-
}
142-
14369
/** switching to long task */
14470
function switchToLongTask() {
14571
timeout = null;
@@ -1118,47 +1044,7 @@ taskmanager.rerunTask = function(options, callback) {
11181044
};
11191045

11201046
taskmanager.stopTask = function(options, callback) {
1121-
options.db = options.db || common.db;
1122-
1123-
/**
1124-
* Stop task
1125-
* @param {object} op_id - operation id for mongo process
1126-
* @param {object} options1.db - database connection
1127-
* @param {string} options1.id - id of the task result
1128-
* @param {object} reqData - request data
1129-
* @param {funciton} callback1 - callback for the result
1130-
*/
1131-
function stopTask(op_id) {
1132-
common.db.admin().command({ killOp: 1, op: Number.parseInt(op_id) }, function(error, result) {
1133-
if (result.ok === 1) {
1134-
callback(null, "Success");
1135-
}
1136-
else {
1137-
callback(null, "Operation could not be stopped");
1138-
}
1139-
});
1140-
}
1141-
1142-
options.db.collection("long_tasks").findOne({ _id: options.id }, function(err, res) {
1143-
if (res) {
1144-
if (res.creator) {
1145-
options.db.collection("members").findOne({ _id: common.db.ObjectID(res.creator) }, function(err1, member) {
1146-
if (member) {
1147-
stopTask(res.op_id);
1148-
}
1149-
else {
1150-
callback(null, "No permission to stop this task");
1151-
}
1152-
});
1153-
}
1154-
else {
1155-
stopTask(res.op_id);
1156-
}
1157-
}
1158-
else {
1159-
callback(null, "Task does not exist");
1160-
}
1161-
});
1047+
callback(null, "Operation could not be stopped");
11621048
};
11631049

11641050
/**
@@ -1201,4 +1087,4 @@ function getResult(callback, options) {
12011087
}
12021088
};
12031089
}
1204-
module.exports = taskmanager;
1090+
module.exports = taskmanager;

bin/scripts/member-managament/delete_old_members.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Promise.all([pluginManager.dbConnection("countly")]).spread(function(countlyDb)
4444
Url: SERVER_URL + "/i/users/delete",
4545
body: {
4646
api_key: API_KEY,
47-
args: JSON.stringify({user_ids: [(data._id + "")]})
47+
args: {user_ids: [data._id + ""]}
4848
}
4949
}, function(data) {
5050
if (data.err) {
@@ -99,8 +99,7 @@ function sendRequest(params, callback) {
9999
const options = {
100100
uri: url.href,
101101
method: params.requestType,
102-
json: true,
103-
body: body,
102+
json: body,
104103
strictSSL: false
105104
};
106105

frontend/express/public/core/user-management/javascripts/countly.views.js

+15-3
Original file line numberDiff line numberDiff line change
@@ -949,8 +949,20 @@
949949
watch: {
950950
'groups': function() {
951951
if (this.groups.length > 0) {
952-
// Remove global admin role if user is assigned to any group
953-
this.$refs.userDrawer.editedObject.global_admin = false;
952+
// Remove global admin role if the assigned groups does not have global admin access
953+
var groupHasGlobalAdmin = false;
954+
955+
this.groups.forEach(function(grpId) {
956+
var group = groupsModel.data().find(function(grp) {
957+
return grpId === grp._id;
958+
});
959+
960+
if (group && group.global_admin === true) {
961+
groupHasGlobalAdmin = true;
962+
}
963+
});
964+
965+
this.$refs.userDrawer.editedObject.global_admin = groupHasGlobalAdmin;
954966
}
955967

956968
if (this.groups.length === 0) {
@@ -1152,4 +1164,4 @@
11521164
countlyVue.container.registerData("user-management/edit-user-drawer", {
11531165
component: Drawer
11541166
});
1155-
})();
1167+
})();

frontend/express/public/javascripts/countly/vue/components/content.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,7 @@
405405
dropdown: 'el-select',
406406
input: 'el-input',
407407
switch: 'el-switch',
408+
slider: 'el-slider',
408409
'color-picker': 'cly-colorpicker',
409410
'input-number': 'el-input-number',
410411
};
@@ -424,6 +425,8 @@
424425
v-bind="inputProps"
425426
:value="localValue"
426427
@input="updateValue"
428+
:min="inputProps && inputProps.min"
429+
:max="inputProps && inputProps.max"
427430
class="cly-vue-content-builder__layout-step__component"
428431
:style="[ position !== 'horizontal' ? {\'width\': \'100%\'} : {\'width\': width + \'px\'}]"
429432
>
@@ -591,4 +594,4 @@
591594
</div>
592595
`
593596
}));
594-
}(window.countlyVue = window.countlyVue || {}));
597+
}(window.countlyVue = window.countlyVue || {}));

frontend/express/public/stylesheets/vue/clyvue.scss

+13-1
Original file line numberDiff line numberDiff line change
@@ -4267,6 +4267,18 @@
42674267
.el-input-group__append {
42684268
padding: 0 8px !important;
42694269
}
4270+
4271+
/* .el-slider__bar {
4272+
background-color: #0166D6;
4273+
}
4274+
4275+
.el-slider__button {
4276+
border-color: #0166D6;
4277+
} */
4278+
4279+
.el-slider__runway {
4280+
background-color: #E2E4E8;
4281+
}
42704282
}
42714283
&__header {
42724284
font-family: Inter;
@@ -4549,4 +4561,4 @@
45494561
cursor: pointer;
45504562
border-radius: 8px;
45514563
}
4552-
}
4564+
}

plugins/crashes/api/api.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,12 @@ plugins.setConfigs("crashes", {
464464
}
465465
updateUser.hadAnyNonfatalCrash = report.ts;
466466
}
467-
let updateData = { $inc: {} };
467+
468+
if ('app_version' in report && typeof report.app_version !== 'string') {
469+
report.app_version += '';
470+
}
471+
let updateData = {$inc: {}};
472+
468473
updateData.$inc["data.crashes"] = 1;
469474
if (Object.keys(updateUser).length) {
470475
updateData.$set = updateUser;

0 commit comments

Comments
 (0)