Skip to content

Commit 4c014d7

Browse files
committed
Merge branch 'release.24.10' into flex
2 parents 89dba78 + 9628c8d commit 4c014d7

File tree

79 files changed

+7845
-7966
lines changed

Some content is hidden

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

79 files changed

+7845
-7966
lines changed

CHANGELOG.md

+19
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## Version 24.10.1
2+
Integrating 24.05.16 fixes
3+
14
## Version 24.10
25
Fixes:
36
- [core] Interpreting carrier value of "--" as an unknown value
@@ -32,6 +35,22 @@ Enterprise Features:
3235
- [users] UI improvements
3336
- [views] Added a quick transition to drill
3437

38+
## Version 24.05.16
39+
Fixes:
40+
- [core] Replaced "Users" with "Sessions" label on technology home widgets
41+
- [push] Replaced push plugin with an earlier version of the plugin
42+
43+
Enterprise fixes:
44+
- [license] Fixed bug with MAU type of licenses that would prevent the server from starting
45+
- [nps] Fixed bug where it was possible to submit empty nps surveys
46+
- [ratings] Fixed bug with user consent
47+
48+
Security:
49+
- Bumped cookie-parser from 1.4.6 to 1.4.7
50+
- Bumped express-rate-limit from 7.4.0 to 7.4.1
51+
- Bumped moment-timezone from 0.5.45 to 0.5.46
52+
- Bumped sass from 1.79.3 to 1.79.4
53+
3554
## Version 24.05.15
3655
Enterprise fixes:
3756
- [nps] Fixed UI issues in the widget editor related to the "user consent" section

api/parts/jobs/runner.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function setup() {
4040
});
4141
}
4242
else {
43-
collection = col;
43+
collection = common.db.collection(COLLECTION);
4444
setImmediate(periodic);
4545
}
4646
});

frontend/express/public/core/device-and-type/templates/technologyHomeWidget.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<div class="version-graph-block bu-p-3" :data-test-id="`cly-section-${item.title.toLowerCase().replaceAll(/\s/g, '-')}-item-${idx2}`">
1313
<div class="bu-columns version-graph-title">
1414
<div class="bu-column" :data-test-id="`cly-section-${item.title.toLowerCase().replaceAll(/\s/g, '-')}-item-${idx2}-name`">{{item2.name}}</div>
15-
<div class="bu-column" :data-test-id="`cly-section-${item.title.toLowerCase().replaceAll(/\s/g, '-')}-item-${idx2}-value`">{{formatNumber(item2.value)}} {{item2.value > 1 ? 'Users' : 'User'}}<span class="divider" :data-test-id="`cly-section-${item.title.toLowerCase().replaceAll(/\s/g, '-')}-item-${idx2}-divider`"> | </span><span :data-test-id="`cly-section-${item.title.toLowerCase().replaceAll(/\s/g, '-')}-item-${idx2}-percent`">{{item2.percent}}% </span></div>
15+
<div class="bu-column" :data-test-id="`cly-section-${item.title.toLowerCase().replaceAll(/\s/g, '-')}-item-${idx2}-value`">{{formatNumber(item2.value)}} {{item2.value > 1 ? i18n('common.sessions') : i18n('common.session')}}<span class="divider" :data-test-id="`cly-section-${item.title.toLowerCase().replaceAll(/\s/g, '-')}-item-${idx2}-divider`"> | </span><span :data-test-id="`cly-section-${item.title.toLowerCase().replaceAll(/\s/g, '-')}-item-${idx2}-percent`">{{item2.percent}}% </span></div>
1616
</div>
1717
<cly-progress-bar :data-test-id="`cly-section-${item.title.toLowerCase().replaceAll(/\s/g, '-')}-item-${idx2}-progress-bar`" :entities="item2.bar" :height=8></cly-progress-bar>
1818
</div>

frontend/express/public/localization/dashboard/dashboard.properties

+2
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,8 @@ common.selected-with-count ={0} Selected
255255
common.selected = Selected
256256
common.select-all-with-count = Select all {0}
257257
common.deselect = Deselect
258+
common.session = Session
259+
common.sessions = Sessions
258260

259261
#vue
260262
common.undo = Undo

plugins/push/api/api-drill.js

+36-168
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
const common = require('../../../api/utils/common'),
22
countlyCommon = require('../../../api/lib/countly.common.js'),
3-
log = common.log('push:api:drill'),
4-
{ FIELDS_TITLES } = require('./send/platforms');
3+
log = common.log('push:api:drill');
54

65
module.exports.drillAddPushEvents = ({uid, params, events, event}) => {
76
return new Promise((res, rej) => {
@@ -95,190 +94,59 @@ function messageQuery(message) {
9594
}
9695
}
9796

98-
/**
99-
* Find messages using particular query and return ids
100-
*
101-
* @param {object} q message collection query
102-
* @returns {String[]} array of message ids
103-
*/
104-
async function find(q) {
105-
let ids = await common.db.collection('messages').find(q, {projection: {_id: 1}}).toArray();
106-
ids = (ids || []).map(id => id._id.toString());
107-
return ids.length ? ids : ['nope'];
108-
}
109-
110-
const toIdsMappers = {
111-
'message.name': (query, app_id) => find({app: common.db.ObjectID(app_id), 'info.title': query}),
112-
'message.title': (query, app_id) => find({app: common.db.ObjectID(app_id), 'contents.title': query}),
113-
'message.message': (query, app_id) => find({app: common.db.ObjectID(app_id), 'contents.message': query}),
114-
};
115-
116-
module.exports.drillPreprocessQuery = async function({query, params}) {
117-
if (query && params && params.qstring && params.qstring.event === '[CLY]_push_action') {
118-
if (query.$or) {
119-
for (let i = 0; i < query.$or.length; i++) {
120-
let q = query.$or[i];
121-
for (let k in q) {
122-
if (toIdsMappers[k]) {
123-
let ids = await toIdsMappers[k](q[k], params.app_id);
124-
log.d(`replaced query.$or[${i}] (%j) with %j`, query.$or[i], {'sg.i': {$in: ids}});
125-
query.$or[i] = {
126-
'sg.i': {$in: ids}
127-
};
128-
}
129-
}
97+
module.exports.drillPreprocessQuery = ({query, params}) => {
98+
if (query) {
99+
if (query.push) {
100+
if (query.push.$nin) {
101+
query.$and = query.push.$nin.map(tk => {
102+
return {$or: [{[tk]: false}, {[tk]: {$exists: false}}]};
103+
});
130104
}
131-
}
132-
for (let k in query) {
133-
if (toIdsMappers[k]) {
134-
let ids = await toIdsMappers[k](query[k], params.app_id);
135-
if (query['sg.i'] && query['sg.i'].$in) {
136-
query['sg.i'].$in = query['sg.i'].$in.filter(id => ids.includes(id));
137-
}
138-
else if (query['sg.i']) {
139-
query['sg.i'].$in = ids;
140-
}
141-
else {
142-
query['sg.i'] = {$in: ids};
143-
}
144-
log.d(`replaced query[${k}] (%j) with %j`, query[k], query['sg.i']);
145-
delete query[k];
105+
if (query.push.$in) {
106+
let q = query.push.$in.map(tk => {
107+
return {[tk]: true};
108+
});
109+
query.$or = q;
146110
}
111+
delete query.push;
147112
}
148-
if (query['sg.i'] && query['sg.i'].$in && !query['sg.i'].$in.length) {
149-
query['sg.i'].$in = ['nope'];
150-
}
151-
// if (query.push) {
152-
// if (query.push.$nin) {
153-
// query.$and = query.push.$nin.map(tk => {
154-
// return {$or: [{[tk]: false}, {[tk]: {$exists: false}}]};
155-
// });
156-
// }
157-
// if (query.push.$in) {
158-
// let q = query.push.$in.map(tk => {
159-
// return {[tk]: true};
160-
// });
161-
// query.$or = q;
162-
// }
163-
// delete query.push;
164-
// }
165-
}
166-
else if (query && params) {
113+
167114
if (query.message) {
168115
let q = messageQuery(query.message);
169116

170117
if (!q) {
171-
return;
118+
return Promise.resolve();
172119
}
173120

174121
log.d(`removing message ${JSON.stringify(query.message)} from queryObject`);
175122
delete query.message;
176123

177-
try {
178-
let ids = await common.db.collection(`push_${params.app_id}`).find(q, {projection: {_id: 1}}).toArray();
179-
ids = (ids || []).map(id => id._id);
180-
query.uid = {$in: ids};
181-
log.d(`filtered by message: uids out of ${ids.length}`);
182-
}
183-
catch (e) {
184-
log.e(e);
185-
}
186-
}
187-
}
188-
189-
if (query.push) {
190-
let q;
191-
if (query.push.$nin) {
192-
q = {
193-
$and: query.push.$nin.map(tk => {
194-
return {[tk]: {$exists: false}};
195-
})
196-
};
197-
}
198-
if (query.push.$in) {
199-
q = {
200-
$or: query.push.$in.map(tk => {
201-
return {[tk]: {$exists: true}};
202-
})
203-
};
204-
}
205-
if (query.push.$regex) {
206-
q = Object.keys(FIELDS_TITLES).filter(k => query.push.$regex.test(FIELDS_TITLES[k])).map(tk => {
207-
return {[tk]: {$exists: true}};
208-
});
209-
}
210-
211-
delete query.push;
212-
213-
if (q) {
214-
if (query.$or) {
215-
query.$and = [query.$or, q];
216-
}
217-
else if (query.$and) {
218-
query.$and = [query.$and, q];
219-
}
220-
else {
221-
for (let k in q) {
222-
query[k] = q[k];
124+
return new Promise((res, rej) => {
125+
try {
126+
common.db.collection(`push_${params.app_id}`).find(q, {projection: {_id: 1}}).toArray((err, ids) => {
127+
if (err) {
128+
rej(err);
129+
}
130+
else {
131+
ids = (ids || []).map(id => id._id);
132+
query.uid = {$in: ids};
133+
log.d(`filtered by message: uids out of ${ids.length}`);
134+
res();
135+
}
136+
});
223137
}
224-
}
138+
catch (e) {
139+
log.e(e);
140+
rej(e);
141+
}
142+
});
225143
}
226144
}
227145
};
228146

229-
// module.exports.drillPreprocessQuery = ({query, params}) => {
230-
// if (query) {
231-
// if (query.push) {
232-
// if (query.push.$nin) {
233-
// query.$and = query.push.$nin.map(tk => {
234-
// return {$or: [{[tk]: false}, {[tk]: {$exists: false}}]};
235-
// });
236-
// }
237-
// if (query.push.$in) {
238-
// let q = query.push.$in.map(tk => {
239-
// return {[tk]: true};
240-
// });
241-
// query.$or = q;
242-
// }
243-
// delete query.push;
244-
// }
245-
246-
// if (query.message) {
247-
// let q = messageQuery(query.message);
248-
249-
// if (!q) {
250-
// return;
251-
// }
252-
253-
// log.d(`removing message ${JSON.stringify(query.message)} from queryObject`);
254-
// delete query.message;
255-
256-
// return new Promise((res, rej) => {
257-
// try {
258-
// common.db.collection(`push_${params.app_id}`).find(q, {projection: {_id: 1}}).toArray((err, ids) => {
259-
// if (err) {
260-
// rej(err);
261-
// }
262-
// else {
263-
// ids = (ids || []).map(id => id._id);
264-
// query.uid = {$in: ids};
265-
// log.d(`filtered by message: uids out of ${ids.length}`);
266-
// res();
267-
// }
268-
// });
269-
// }
270-
// catch (e) {
271-
// log.e(e);
272-
// rej(e);
273-
// }
274-
// });
275-
// }
276-
// }
277-
// };
278-
279147
module.exports.drillPostprocessUids = ({uids, params}) => new Promise((res, rej) => {
280-
let message = params && params.initialQueryObject && params.initialQueryObject.message;
281-
if (uids && uids.length && message) {
148+
let message = params.initialQueryObject && params.initialQueryObject.message;
149+
if (uids.length && message) {
282150
log.d(`filtering ${uids.length} uids by message`);
283151

284152
let q = messageQuery(message);

0 commit comments

Comments
 (0)