Skip to content

Commit 5914f8e

Browse files
authored
Merge branch 'release.24.05' into ar2rsawseen/24.05
2 parents 3dd0f0d + db03d33 commit 5914f8e

File tree

56 files changed

+1922
-441
lines changed

Some content is hidden

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

56 files changed

+1922
-441
lines changed

CHANGELOG.md

Lines changed: 86 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,88 @@
1+
## Version 24.05.41
2+
Enterprise Fixes:
3+
- [cohorts] Fix query transformation for profile group
4+
- [users] Fix condition for custom property update
5+
- [users] Update user custom field number formatting
6+
7+
8+
## Version 24.05.40
9+
Fixes:
10+
- [populator] Fix NPS generator
11+
12+
13+
## Version 24.05.39
14+
Features:
15+
- [remote-config] Enable comparing newer/older app version in conditions
16+
17+
Fixes:
18+
- [remote-config] Fix condition matching with compound conditions
19+
20+
21+
## Version 24.05.38
22+
Enterprise Fixes:
23+
- [home] Fix home download render issue
24+
25+
## Version 24.05.37
26+
Enterprise Fixes:
27+
- [license] Update license metric endpoint permission
28+
29+
30+
## Version 24.05.36
31+
Features:
32+
- [plugins] Add configuration warning tags to settings UI
33+
34+
## Version 24.05.35
35+
Fixes:
36+
- [core] Fix mongo connection url parsing
37+
- [dashboards] Delete associated widgets and reports when a dashboard is removed
38+
39+
Enterprise Fixes:
40+
- [flows] Null checks on $size when calculating flows.
41+
42+
## Version 24.05.34
43+
Enterprise Fixes:
44+
- [drill] Fixed typo issue while getting segment values in drill widgets
45+
46+
## Version 24.05.33
47+
Fixes:
48+
- [emails] [puppeteer] [fix] Allow chrome to launch multiple instances
49+
50+
51+
## Version 24.05.32
52+
Enterprise Fixes:
53+
- [active-users] Fixed bug related to selecting calculation ranges. As a result, some dates were previously calculated on incomplete data set.
54+
55+
56+
## Version 24.05.31
57+
Fixes:
58+
- [feedback] Uniformize drawer internal name input texts
59+
- [feedback] Uniformize feedback widgets status tag
60+
- [star-rating] Allow bulk update of widget status
61+
- [star-rating] Fix rating score and responses table sorting
62+
- [UI] Remove white background from input character amount suffix
63+
64+
Enterprise Fixes:
65+
- [retention] Fixed report loading
66+
67+
68+
## Version 24.05.30
69+
Features:
70+
- [crashed] Fix unescaped SDK logs
71+
- [dashboards] Added the option to set a refresh rate for dashboards, allowing data to update more frequently for selected dashboards
72+
- [star-rating] Added missing columns to Rating Widgets table edit
73+
- [ui] Fix alignment of drawers title and close icon
74+
75+
## Version 24.05.29
76+
Fixes:
77+
- [core] Allow downloading data also from other databases in dbviewer
78+
- [crash_symbolication] Symbolication server api end point test fix
79+
- [push] Fixed push notifications title and content text and variables combination
80+
- [reports] Correctly match event for email report if event key contains '.'
81+
82+
## Version 24.05.28
83+
Enterprise Fixes:
84+
- [cohorts] Fixed issue with combining multiple cohorts
85+
186
## Version 24.05.27
287
Fixes:
388
- [crashes] Remove memory addresses from stack trace grouping
@@ -57,7 +142,7 @@ Enterprise fixes:
57142
- [drill] [license] Update license loader to enable supplying db client
58143
- [users] Format data points displayed in user sidebar
59144
- [cohorts] Unescape drill texts in cohort component
60-
145+
61146
Dependencies:
62147
- Bump fs-extra from 11.2.0 to 11.3.0
63148
- Bump nodemailer from 6.9.16 to 6.10.0
@@ -4495,4 +4580,3 @@ This version provides several features and bugfixes to both server and SDKs. The
44954580
A user of an application can only view analytics for that application
44964581
and cannot edit its settings.
44974582
* Added csfr protection to all methods provided through app.js.
4498-

api/utils/render.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ var chromePath = "";
2525
var countlyFs = require('./countlyFs');
2626
var log = require('./log.js')('core:render');
2727
var countlyConfig = require('./../config', 'dont-enclose');
28+
var fs = require('fs');
2829

2930

3031
/**
@@ -69,7 +70,7 @@ exports.renderView = function(options, cb) {
6970
},
7071
args: ['--no-sandbox', '--disable-setuid-sandbox', '--ignore-certificate-errors'],
7172
ignoreHTTPSErrors: true,
72-
userDataDir: pathModule.resolve(__dirname, "../../dump/chrome")
73+
userDataDir: pathModule.resolve(__dirname, "../../dump/chrome/" + Date.now())
7374
};
7475

7576
if (chromePath) {
@@ -251,6 +252,9 @@ exports.renderView = function(options, cb) {
251252
await bodyHandle.dispose();
252253
await browser.close();
253254

255+
// Remove user data directory after use
256+
fs.rmSync(settings.userDataDir, { recursive: true, force: true });
257+
254258
var imageData = {
255259
image: image,
256260
path: path
@@ -261,6 +265,8 @@ exports.renderView = function(options, cb) {
261265
catch (e) {
262266
log.e("Headless chrome browser error", e);
263267
await browser.close();
268+
// Remove user data directory after use
269+
fs.rmSync(settings.userDataDir, { recursive: true, force: true });
264270
return cb(e);
265271
}
266272
}

api/utils/requestProcessor.js

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const validateUserForGlobalAdmin = validateGlobalAdmin;
2424
const validateUserForMgmtReadAPI = validateUser;
2525
const request = require('countly-request')(plugins.getConfig("security"));
2626
const Handle = require('../../api/parts/jobs/index.js');
27+
const render = require('../../api/utils/render.js');
2728

2829
var loaded_configs_time = 0;
2930

@@ -466,6 +467,45 @@ const processRequest = (params) => {
466467
}
467468
break;
468469
}
470+
case '/o/render': {
471+
validateUserForRead(params, function() {
472+
var options = {};
473+
var view = params.qstring.view || "";
474+
var route = params.qstring.route || "";
475+
var id = params.qstring.id || "";
476+
477+
options.view = view + "#" + route;
478+
options.id = id ? "#" + id : "";
479+
480+
var imageName = "screenshot_" + common.crypto.randomBytes(16).toString("hex") + ".png";
481+
482+
options.savePath = path.resolve(__dirname, "../../frontend/express/public/images/screenshots/" + imageName);
483+
options.source = "core";
484+
485+
authorize.save({
486+
db: common.db,
487+
multi: false,
488+
owner: params.member._id,
489+
ttl: 300,
490+
purpose: "LoginAuthToken",
491+
callback: function(err2, token) {
492+
if (err2) {
493+
common.returnMessage(params, 400, 'Error creating token: ' + err2);
494+
return false;
495+
}
496+
options.token = token;
497+
render.renderView(options, function(err3) {
498+
if (err3) {
499+
common.returnMessage(params, 400, 'Error creating screenshot: ' + err3);
500+
return false;
501+
}
502+
common.returnOutput(params, {path: common.config.path + "/images/screenshots/" + imageName});
503+
});
504+
}
505+
});
506+
});
507+
break;
508+
}
469509
case '/i/app_users': {
470510
switch (paths[3]) {
471511
case 'create': {
@@ -2130,8 +2170,16 @@ const processRequest = (params) => {
21302170

21312171
dbUserHasAccessToCollection(params, params.qstring.collection, (hasAccess) => {
21322172
if (hasAccess) {
2173+
var dbs = { countly: common.db, countly_drill: common.drillDb, countly_out: common.outDb, countly_fs: countlyFs.gridfs.getHandler() };
2174+
var db = "";
2175+
if (params.qstring.db && dbs[params.qstring.db]) {
2176+
db = dbs[params.qstring.db];
2177+
}
2178+
else {
2179+
db = common.db;
2180+
}
21332181
countlyApi.data.exports.fromDatabase({
2134-
db: (params.qstring.db === "countly_drill") ? common.drillDb : (params.qstring.dbs === "countly_drill") ? common.drillDb : common.db,
2182+
db: db,
21352183
params: params,
21362184
collection: params.qstring.collection,
21372185
query: params.qstring.query,

api/utils/taskmanager.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,13 @@ taskmanager.rerunTask = function(options, callback) {
972972
});
973973
}
974974

975-
options.db.collection("long_tasks").findOne({_id: options.id}, function(err, res) {
975+
var qq = {_id: options.id};
976+
if (options.additionalQuery) {
977+
qq = options.additionalQuery;
978+
qq._id = options.id;
979+
}
980+
log.d("Fetching from long_tasks to rerun: " + JSON.stringify(qq));
981+
options.db.collection("long_tasks").findOne(qq, function(err, res) {
976982
if (!err && res && res.request) {
977983
var reqData = {};
978984
try {
@@ -982,6 +988,7 @@ taskmanager.rerunTask = function(options, callback) {
982988
reqData = {};
983989
}
984990
if (reqData.uri) {
991+
reqData.json = reqData.json || {};
985992
reqData.json.task_id = options.id;
986993
reqData.strictSSL = false;
987994
if (reqData.json && reqData.json.period && Array.isArray(reqData.json.period)) {

0 commit comments

Comments
 (0)