Skip to content

Commit a1255fe

Browse files
authored
Merge branch 'master' into SER-2124
2 parents 0323904 + a800e0b commit a1255fe

File tree

5 files changed

+52
-5
lines changed

5 files changed

+52
-5
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
## Version 24.05.XX
22
Fixes:
33
- [script] Fixing bug with "delete_old_members" script that led to malformed requests
4+
- [core] Fixed bug where changing passwords results in the loss of the "Global Admin" role
5+
- [crash] Fixed bug in crash ingestion for scenarios where the "app version" is not a string.
46

57
## Version 24.05.17
68
Fixes:
@@ -38,6 +40,7 @@ Security:
3840

3941
## Version 24.05.15
4042
Enterprise fixes:
43+
- [ab-testing] Fixed JSON.parse issue preventing creation of AB tests
4144
- [nps] Fixed UI issues in the widget editor related to the "user consent" section
4245
- [ratings] Fixed rendering issue for escaped values
4346

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+
})();

plugins/crashes/api/api.js

+3
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,9 @@ plugins.setConfigs("crashes", {
464464
}
465465
updateUser.hadAnyNonfatalCrash = report.ts;
466466
}
467+
if ('app_version' in report && typeof report.app_version !== 'string') {
468+
report.app_version += '';
469+
}
467470
let updateData = {$inc: {}};
468471
updateData.$inc["data.crashes"] = 1;
469472
if (Object.keys(updateUser).length) {

plugins/crashes/tests.js

+30-1
Original file line numberDiff line numberDiff line change
@@ -3091,6 +3091,35 @@ describe('Testing Crashes', function() {
30913091
});
30923092
});
30933093

3094+
describe('Crash app version', async() => {
3095+
it('should process crash app version as string', async() => {
3096+
const crashData = {
3097+
"_error": "error",
3098+
"_app_version": 123, // app version is number
3099+
"_os": "android",
3100+
};
3101+
3102+
await request.get('/i')
3103+
.query({ app_key: APP_KEY, device_id: DEVICE_ID, crash: JSON.stringify(crashData) })
3104+
.expect(200);
3105+
3106+
const crashGroupQuery = JSON.stringify({
3107+
latest_version: { $in: [`${crashData._app_version}`] },
3108+
});
3109+
let crashGroupResponse = await request
3110+
.get('/o')
3111+
.query({ method: 'crashes', api_key: API_KEY_ADMIN, app_id: APP_ID, query: crashGroupQuery });
3112+
const crashGroup = crashGroupResponse.body.aaData[0];
3113+
crashGroupResponse = await request
3114+
.get(`/o?`)
3115+
.query({ method: 'crashes', api_key: API_KEY_ADMIN, app_id: APP_ID, group: crashGroup._id });
3116+
3117+
const crash = crashGroupResponse.body.data[0];
3118+
3119+
crash.app_version.should.equal(`${crashData._app_version}`);
3120+
});
3121+
});
3122+
30943123
describe('Reset app', function() {
30953124
it('should reset data', function(done) {
30963125
var params = {app_id: APP_ID, period: "reset"};
@@ -3144,4 +3173,4 @@ describe('Testing Crashes', function() {
31443173
});
31453174
});
31463175
});
3147-
});
3176+
});

plugins/views/scripts/omitViewSegments.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ function getAppList(options, callback) {
110110
if (app_list && app_list.length > 0) {
111111
var listed = [];
112112
for (var z = 0; z < app_list.length; z++) {
113-
listed.push(options.db.ObjectId(app_list[z]));
113+
listed.push(options.db.ObjectID(app_list[z]));
114114
}
115115
query = {_id: {$in: listed}};
116116
}

0 commit comments

Comments
 (0)