Skip to content

Commit d2e8150

Browse files
authored
Merge branch 'master' into dependabot/npm_and_yarn/mongodb-6.19.0
2 parents 58ec0a7 + 38a3291 commit d2e8150

File tree

13 files changed

+141
-146
lines changed

13 files changed

+141
-146
lines changed

CHANGELOG.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,28 @@
1+
## Version 25.03.XX
2+
Enterprise Fixes
3+
- [journeys] Fix for handling the skip threshold value when saving the journey
4+
- [journeys] Performance improvement on journey stat user list & UI bugfixes
5+
6+
## Version 25.03.18
7+
Fixes:
8+
- [server-stats] Add new events to breakdown
9+
- [server-stats] Fix breakdown event calculation
10+
11+
Enterprise Fixes:
12+
- [journeys] Fix for clearing content queue when journey is paused
13+
- [journeys] Fix for content shown event handling
14+
- [journeys] Fix for performance issues when huge number of journey instances created
15+
- [journeys] Update skip threshold when journeys are paused
16+
17+
Dependencies:
18+
- Bump get-random-values from 3.0.0 to 4.0.0
19+
- Bump puppeteer from 24.16.1 to 24.16.2
20+
121
## Version 25.03.17
222
Enterprise Fixes:
323
- [ldap] Recursive user search in ldap added
424
- [license] Update metric endpoint permission
5-
25+
626
Dependencies:
727
- Bump puppeteer from 24.16.2 to 24.17.0
828

api/utils/requestProcessor.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const validateUserForGlobalAdmin = validateGlobalAdmin;
2929
const validateUserForMgmtReadAPI = validateUser;
3030
const request = require('countly-request')(plugins.getConfig("security"));
3131
const Handle = require('../../api/parts/jobs/index.js');
32+
const render = require('../../api/utils/render.js');
3233

3334
var loaded_configs_time = 0;
3435

@@ -362,6 +363,45 @@ const processRequest = (params) => {
362363
}
363364
break;
364365
}
366+
case '/o/render': {
367+
validateUserForRead(params, function() {
368+
var options = {};
369+
var view = params.qstring.view || "";
370+
var route = params.qstring.route || "";
371+
var id = params.qstring.id || "";
372+
373+
options.view = view + "#" + route;
374+
options.id = id ? "#" + id : "";
375+
376+
var imageName = "screenshot_" + common.crypto.randomBytes(16).toString("hex") + ".png";
377+
378+
options.savePath = path.resolve(__dirname, "../../frontend/express/public/images/screenshots/" + imageName);
379+
options.source = "core";
380+
381+
authorize.save({
382+
db: common.db,
383+
multi: false,
384+
owner: params.member._id,
385+
ttl: 300,
386+
purpose: "LoginAuthToken",
387+
callback: function(err2, token) {
388+
if (err2) {
389+
common.returnMessage(params, 400, 'Error creating token: ' + err2);
390+
return false;
391+
}
392+
options.token = token;
393+
render.renderView(options, function(err3) {
394+
if (err3) {
395+
common.returnMessage(params, 400, 'Error creating screenshot: ' + err3);
396+
return false;
397+
}
398+
common.returnOutput(params, {path: common.config.path + "/images/screenshots/" + imageName});
399+
});
400+
}
401+
});
402+
});
403+
break;
404+
}
365405
case '/i/app_users': {
366406
switch (paths[3]) {
367407
case 'create': {

frontend/express/app.js

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ var versionInfo = require('./version.info'),
6767
url = require('url'),
6868
authorize = require('../../api/utils/authorizer.js'), //for token validations
6969
languages = require('../../frontend/express/locale.conf'),
70-
render = require('../../api/utils/render.js'),
7170
rateLimit = require("express-rate-limit"),
7271
membersUtility = require("./libs/members.js"),
7372
argon2 = require('argon2'),
@@ -1877,48 +1876,6 @@ Promise.all([plugins.dbConnection(countlyConfig), plugins.dbConnection("countly_
18771876
}
18781877
});
18791878

1880-
app.get(countlyConfig.path + '/render', function(req, res) {
1881-
if (!req.session.uid) {
1882-
return res.redirect(countlyConfig.path + '/login');
1883-
}
1884-
1885-
var options = {};
1886-
var view = req.query.view || "";
1887-
var route = req.query.route || "";
1888-
var id = req.query.id || "";
1889-
1890-
options.view = view + "#" + route;
1891-
options.id = id ? "#" + id : "";
1892-
1893-
var randomString = (+new Date()).toString() + (Math.random()).toString();
1894-
var imageName = "screenshot_" + sha1Hash(randomString) + ".png";
1895-
1896-
options.savePath = path.resolve(__dirname, "./public/images/screenshots/" + imageName);
1897-
options.source = "core";
1898-
1899-
authorize.save({
1900-
db: countlyDb,
1901-
multi: false,
1902-
owner: req.session.uid,
1903-
ttl: 300,
1904-
purpose: "LoginAuthToken",
1905-
callback: function(err2, token) {
1906-
if (err2) {
1907-
console.log(err2);
1908-
return res.send(false);
1909-
}
1910-
options.token = token;
1911-
render.renderView(options, function(err3) {
1912-
if (err3) {
1913-
return res.send(false);
1914-
}
1915-
1916-
return res.send({path: countlyConfig.path + "/images/screenshots/" + imageName});
1917-
});
1918-
}
1919-
});
1920-
});
1921-
19221879
app.get(countlyConfig.path + '/login/token/:token', function(req, res) {
19231880
membersUtility.loginWithToken(req, function(member) {
19241881
if (member) {

frontend/express/public/core/home/javascripts/countly.models.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* global countlyVue,CV,countlyCommon*/
1+
/* global countlyVue,CV,countlyCommon,countlyGlobal*/
22

33
(function(countlyHomeView) {
44
countlyHomeView.getVuexModule = function() {
@@ -12,11 +12,12 @@
1212
var HomeViewActions = {
1313
downloadScreen: function(context) {
1414
return CV.$.ajax({
15-
type: "GET",
16-
url: "/render?view=/dashboard&route=/" + countlyCommon.ACTIVE_APP_ID + "/",
15+
type: "POST",
16+
url: "/o/render?view=/dashboard&route=/" + countlyCommon.ACTIVE_APP_ID + "/",
1717
data: {
1818
app_id: countlyCommon.ACTIVE_APP_ID,
1919
"id": "main_home_view",
20+
api_key: countlyGlobal.member.api_key,
2021
options: JSON.stringify({"dimensions": {"width": 2000, "padding": 25}})
2122
},
2223
dataType: "json"

frontend/express/public/core/home/javascripts/countly.views.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ var HomeViewView = countlyVue.views.create({
222222
CountlyHelpers.notify({type: "ok", title: jQuery.i18n.map["common.success"], message: jQuery.i18n.map["home.download.starting"], sticky: true, clearAll: true});
223223
this.$store.dispatch("countlyHomeView/downloadScreen").then(function() {
224224
if (self.$store.state.countlyHomeView.image) {
225-
CountlyHelpers.notify({type: "ok", title: jQuery.i18n.map["common.success"], message: "<a href='" + self.$store.state.countlyHomeView.image + "'>" + jQuery.i18n.map["common.download"] + "</a>", sticky: true, clearAll: true});
225+
CountlyHelpers.notify({type: "ok", title: jQuery.i18n.map["common.success"], message: "<a href='" + self.$store.state.countlyHomeView.image + "' target='_blank'>" + jQuery.i18n.map["common.download"] + "</a>", sticky: true, clearAll: true, html: true});
226226
}
227227
else {
228228
CountlyHelpers.notify({type: "error", title: jQuery.i18n.map["common.error"], message: jQuery.i18n.map["common.error"], sticky: false, clearAll: true});

frontend/express/public/javascripts/countly/countly.helpers.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,12 @@
337337
}
338338
var payload = {};
339339
var persistent = msg.persistent;
340-
payload.text = countlyCommon.encodeHtml(msg.message);
340+
if (msg.html) {
341+
payload.text = msg.message;
342+
}
343+
else {
344+
payload.text = countlyCommon.encodeHtml(msg.message);
345+
}
341346
payload.autoHide = !msg.sticky;
342347
payload.id = msg.id;
343348
payload.width = msg.width;

plugins/dashboards/frontend/public/templates/email.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
<td style="padding: 30px 0px 30px 0px;" class="logo" align="center">
8181
<table border="0" cellpadding="0" cellspacing="0" width="100%" >
8282
<tr>
83-
<td bgcolor="#ffffff" width="100" align="left"><a href="<%= version.page %>" target="_blank"><img alt="Logo" src="<%= typeof localhost !== 'undefined' ? localhost : host %>/images/pre-login/countly-logo-dark.png" width="150" style="display: block; font-family: Helvetica, Arial, sans-serif; color: #666666; font-size: 16px;" border="0"></a></td>
83+
<td bgcolor="#ffffff" width="100" align="left"><a href="<%= version.page %>" target="_blank"><img alt="Logo" src="<%= typeof localhost !== 'undefined' ? localhost : host %>/images/pre-login/countly-logo-dark.png" width="150" style="display: block; font-family: Helvetica, Arial, sans-serif; color: #666666; font-size: 16px;" border="0" data-test-id="countly-logo"></a></td>
8484
</tr>
8585
</table>
8686
</td>
@@ -99,7 +99,7 @@
9999
<td>
100100
<table width="100%" align="center" border="0" cellspacing="0" cellpadding="0">
101101
<tr>
102-
<td align="center" style="padding-top: 0px;" ><img alt="Dashboard" src="<%= typeof localhost !== 'undefined' ? localhost : host %>/dashboards/images/screenshots/<%= image.name %>" width="750" style="display: block;" border="0"></img></td>
102+
<td align="center" style="padding-top: 0px;" ><img alt="Dashboard" src="<%= typeof localhost !== 'undefined' ? localhost : host %>/dashboards/images/screenshots/<%= image.name %>" width="750" style="display: block;" border="0" data-test-id="dashboard-image"></img></td>
103103
</tr>
104104
</table>
105105
</td>
@@ -142,4 +142,4 @@
142142
<!-- /Gmail hack -->
143143

144144
</body>
145-
</html>
145+
</html>

plugins/server-stats/api/parts/stats.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,10 @@ function increaseDataPoints(object, data) {
128128
object.ratings += (data.str || 0);
129129
object.apm += (data.apm || 0);
130130
object.custom += (data.ce || 0);
131-
object.cs = (data.cs || 0);
132-
object.ps = (data.ps || 0);
131+
object.cs += (data.cs || 0);
132+
object.ps += (data.ps || 0);
133+
object.llm += (data.llm || 0);
134+
object.aclk += (data.aclk || 0);
133135
if (data.dp) {
134136
object.dp += data.dp;
135137
}
@@ -241,7 +243,7 @@ function fetchDatapoints(db, filter, options, callback) {
241243
options.dateObjPrev = options.dateObjPrev || {};
242244
db.collection("server_stats_data_points").find(filter, {}).toArray(function(err, result) {
243245
var toReturn = {
244-
"all-apps": {"events": 0, "sessions": 0, "push": 0, "dp": 0, "change": 0, "crash": 0, "views": 0, "actions": 0, "nps": 0, "surveys": 0, "ratings": 0, "apm": 0, "custom": 0},
246+
"all-apps": {"events": 0, "sessions": 0, "push": 0, "dp": 0, "change": 0, "crash": 0, "views": 0, "actions": 0, "nps": 0, "surveys": 0, "ratings": 0, "apm": 0, "custom": 0, cs: 0, ps: 0, llm: 0, aclk: 0},
245247
};
246248

247249
if (err || !result) {
@@ -280,7 +282,7 @@ function fetchDatapoints(db, filter, options, callback) {
280282

281283
for (let i = 0; i < result.length; i++) {
282284
if (!toReturn[result[i].a]) {
283-
toReturn[result[i].a] = {"events": 0, "sessions": 0, "push": 0, "dp": 0, "change": 0, "crash": 0, "views": 0, "actions": 0, "nps": 0, "surveys": 0, "ratings": 0, "apm": 0, "custom": 0};
285+
toReturn[result[i].a] = {"events": 0, "sessions": 0, "push": 0, "dp": 0, "change": 0, "crash": 0, "views": 0, "actions": 0, "nps": 0, "surveys": 0, "ratings": 0, "apm": 0, "custom": 0, cs: 0, ps: 0, llm: 0, aclk: 0};
284286
}
285287
const dates = result[i].d;
286288
if (options.dateObj[result[i].m]) {

plugins/server-stats/frontend/public/javascripts/countly.models.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@
122122
"ps": periodData.ps,
123123
"cs": periodData.cs,
124124
"custom": periodData.custom,
125+
llm: periodData.llm,
126+
aclk: periodData.aclk,
125127
};
126128
let sortable = [];
127129
for (var event in brokendownEvents) {
@@ -152,7 +154,10 @@
152154
"ps": periodData.ps,
153155
"cs": periodData.cs,
154156
"custom": periodData.custom,
157+
llm: periodData.llm,
158+
aclk: periodData.aclk,
155159
},
160+
156161
"sorted_breakdown": sortable,
157162
});
158163
}
@@ -195,4 +200,4 @@
195200
}
196201
}
197202

198-
})(window.countlyDataPoints = window.countlyDataPoints || {}, jQuery);
203+
})(window.countlyDataPoints = window.countlyDataPoints || {}, jQuery);

plugins/server-stats/frontend/public/javascripts/countly.views.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ var DataPointsView = countlyVue.views.create({
5555
"custom": CV.i18n('server-stats.custom'),
5656
"cs": CV.i18n('server-stats.cs'),
5757
"ps": CV.i18n('server-stats.ps'),
58-
"push": CV.i18n('server-stats.push')
58+
"push": CV.i18n('server-stats.push'),
59+
llm: CV.i18n('server-stats.llm'),
60+
aclk: CV.i18n('server-stats.aclk'),
5961
};
6062
return eventsBreakdownEnum[key];
6163
},
@@ -310,9 +312,11 @@ var DataPointsView = countlyVue.views.create({
310312
item[CV.i18n('server-stats.events') + ": " + CV.i18n('server-stats.ratings')] = dataPoints[k].events_breakdown.ratings;
311313
item[CV.i18n('server-stats.events') + ": " + CV.i18n('server-stats.apm')] = dataPoints[k].events_breakdown.apm;
312314
item[CV.i18n('server-stats.events') + ": " + CV.i18n('server-stats.custom')] = dataPoints[k].events_breakdown.custom;
313-
item[CV.i18n('server-stats.push')] = dataPoints[k].events_breakdown.push;
314-
item[CV.i18n('server-stats.ps')] = dataPoints[k].events_breakdown.ps;
315-
item[CV.i18n('server-stats.cs')] = dataPoints[k].events_breakdown.cs;
315+
item[CV.i18n('server-stats.events') + ": " + CV.i18n('server-stats.push')] = dataPoints[k].events_breakdown.push;
316+
item[CV.i18n('server-stats.events') + ": " + CV.i18n('server-stats.ps')] = dataPoints[k].events_breakdown.ps;
317+
item[CV.i18n('server-stats.events') + ": " + CV.i18n('server-stats.cs')] = dataPoints[k].events_breakdown.cs;
318+
item[CV.i18n('server-stats.events') + ": " + CV.i18n('server-stats.llm')] = dataPoints[k].events_breakdown.llm;
319+
item[CV.i18n('server-stats.events') + ": " + CV.i18n('server-stats.aclk')] = dataPoints[k].events_breakdown.aclk;
316320
item[CV.i18n('server-stats.data-points')] = dataPoints[k]['data-points'];
317321
item[CV.i18n('server-stats.datapoint-change')] = dataPoints[k].change;
318322
table.push(item);
@@ -346,4 +350,4 @@ app.route("/manage/data-points/*id", 'data-points', function(id) {
346350
this.renderWhenReady(this.dataPointsView);
347351
});
348352

349-
app.addMenu("management", {code: "data-point", permission: "server-stats", url: "#/manage/data-points", text: "server-stats.data-points", priority: 40});
353+
app.addMenu("management", {code: "data-point", permission: "server-stats", url: "#/manage/data-points", text: "server-stats.data-points", priority: 40});

0 commit comments

Comments
 (0)