Skip to content

Commit

Permalink
Merge branch 'release.24.12' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
ar2rsawseen committed Jan 7, 2025
2 parents 433041d + 38107a5 commit f9849fd
Show file tree
Hide file tree
Showing 10 changed files with 103 additions and 291 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## Version 24.12.x

Fixes:
- [push] Fixed bug where IOS credentials get mixed up while sending messages from different apps at the same time
- [push] Fixed bug where it crashes in connection pool growth because of a type mismatch in an if condition
Expand All @@ -9,6 +10,10 @@ Features:
Dependencies:
- Bump express from 4.21.1 to 4.21.2
- Bump mocha from 10.2.0 to 10.8.2
- Bump sass from 1.81.0 to 1.83.1
- Bump countly-sdk-nodejs from 24.10.0 to 24.10.1
- Bump express-rate-limit from 7.4.1 to 7.5.0
- Bump puppeteer from 23.10.4 to 23.11.1

## Version 24.12
Features:
Expand Down
8 changes: 7 additions & 1 deletion api/utils/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,13 @@ common.getDate = function(timestamp, timezone) {
* @returns {number} current day of the year
*/
common.getDOY = function(timestamp, timezone) {
var endDate = (timestamp) ? moment.unix(timestamp * 1000) : moment();
var endDate;
if (timestamp && timestamp.toString().length === 13) {
endDate = (timestamp) ? moment.unix(timestamp / 1000) : moment();
}
else {
endDate = (timestamp) ? moment.unix(timestamp) : moment();
}

if (timezone) {
endDate.tz(timezone);
Expand Down
38 changes: 34 additions & 4 deletions frontend/express/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,22 @@
// Set process name
process.title = "countly: dashboard node " + process.argv[1];

var fs = require('fs');
var path = require('path');
var IS_FLEX = false;

if (fs.existsSync(path.resolve('/opt/deployment_env.json'))) {
var deploymentConf = fs.readFileSync('/opt/deployment_env.json', 'utf8');
try {
if (JSON.parse(deploymentConf).DEPLOYMENT_ID) {
IS_FLEX = true;
}
}
catch (e) {
IS_FLEX = false;
}
}

var versionInfo = require('./version.info'),
pack = require('../../package.json'),
COUNTLY_VERSION = versionInfo.version,
Expand All @@ -27,8 +43,6 @@ var versionInfo = require('./version.info'),
}
}),
crypto = require('crypto'),
fs = require('fs'),
path = require('path'),
jimp = require('jimp'),
flash = require('connect-flash'),
cookieParser = require('cookie-parser'),
Expand Down Expand Up @@ -66,7 +80,13 @@ var COUNTLY_NAMED_TYPE = "Countly Lite v" + COUNTLY_VERSION;
var COUNTLY_TYPE_CE = true;
var COUNTLY_TRIAL = (versionInfo.trial) ? true : false;
var COUNTLY_TRACK_TYPE = "OSS";
if (versionInfo.footer) {

if (IS_FLEX) {
COUNTLY_NAMED_TYPE = "Countly v" + COUNTLY_VERSION;
COUNTLY_TYPE_CE = false;
COUNTLY_TRACK_TYPE = "Flex";
}
else if (versionInfo.footer) {
COUNTLY_NAMED_TYPE = versionInfo.footer;
COUNTLY_TYPE_CE = false;
if (COUNTLY_NAMED_TYPE === "Countly Cloud") {
Expand Down Expand Up @@ -907,8 +927,9 @@ Promise.all([plugins.dbConnection(countlyConfig), plugins.dbConnection("countly_
countly_tracking = plugins.isPluginEnabled('tracker') ? true : plugins.getConfig('frontend').countly_tracking,
countly_domain = plugins.getConfig('api').domain,
licenseNotification, licenseError;
var isLocked = false;
configs.export_limit = plugins.getConfig("api").export_limit;
app.loadThemeFiles(configs.theme, function(theme) {
app.loadThemeFiles(configs.theme, async function(theme) {
if (configs._user.theme) {
res.cookie("theme", configs.theme);
}
Expand All @@ -922,6 +943,13 @@ Promise.all([plugins.dbConnection(countlyConfig), plugins.dbConnection("countly_
if (member.upgrade) {
countlyDb.collection('members').update({"_id": member._id}, {$unset: {upgrade: ""}}, function() {});
}
if (IS_FLEX) {
let locked = await countlyDb.collection('mycountly').findOne({_id: 'lockServer'});
if (locked?.isLocked === true) {
isLocked = true;
}

}

if (req.session.licenseError) {
licenseError = req.session.licenseError;
Expand Down Expand Up @@ -989,6 +1017,8 @@ Promise.all([plugins.dbConnection(countlyConfig), plugins.dbConnection("countly_
helpCenterLink: COUNTLY_HELPCENTER_LINK,
featureRequestLink: COUNTLY_FEATUREREQUEST_LINK,
},
mycountly: IS_FLEX,
isLocked: isLocked,
};


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
types: Object.keys(app.appTypes),
appTemplates: appTemplates,
populatorProgress: 0,
populatorMaxTime: 60,
populatorMaxTime: 30,
isPopulatorFinished: false,
isCountlyEE: countlyGlobal.plugins.includes('drill'),
selectedAppTemplate: null,
Expand Down
Loading

0 comments on commit f9849fd

Please sign in to comment.