Skip to content

Commit 02b8e19

Browse files
committed
Merge branch 'master' into release.24.10
# Conflicts: # CHANGELOG.md
2 parents ead2d1e + 830a9e8 commit 02b8e19

File tree

7 files changed

+263
-145
lines changed

7 files changed

+263
-145
lines changed

CHANGELOG.md

+17-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,27 @@
1-
## Version 24.10.xx
1+
## Version 24.10.6
2+
3+
Fixes:
4+
- [push] Using apns-id header as message result in debug mode
5+
- [server-stats] Fix data point calculation in job
6+
- [TopEventsJob] preserver previous state if overwriting fails
7+
- [ui] scroll top on step changes in drawers
8+
29
Enterprise fixes:
10+
- [drill] Encoding url component before changing history state
311
- [drill] Fixed drill meta regeneration
4-
12+
- [drill] [license] Update license loader to enable supplying db client
13+
- [users] Format data points displayed in user sidebar
14+
- [cohorts] Unescape drill texts in cohort component
15+
516
Dependencies:
617
- Bump fs-extra from 11.2.0 to 11.3.0
718
- Bump nodemailer from 6.9.16 to 6.10.0
819

9-
## Version 24.10.5
20+
Enterprise Dependencies:
21+
- Bump nanoid in /plugins/cognito from 2.1.11 to 3.3.8
22+
- Bump shortid in /plugins/cognito from 2.2.16 to 2.2.17
1023

24+
## Version 24.10.5
1125
Fixes:
1226
- [core] Fixed a bug causing events to not being loaded when there's an escaped character in the event name
1327
- [core] Fixed a bug that was causing drill to crash when there's a percentage symbol in the event name

api/jobs/topEvents.js

+23-7
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ class TopEventsJob extends job.Job {
1919
/**
2020
* TopEvents initialize function
2121
*/
22-
init() {
23-
this.getAllApps();
22+
async init() {
23+
return this.getAllApps();
2424
}
2525

2626
/**
@@ -144,6 +144,7 @@ class TopEventsJob extends job.Job {
144144
}
145145
catch (error) {
146146
log.e("TopEvents Job has a error: ", error);
147+
throw error;
147148
}
148149
}
149150

@@ -157,7 +158,18 @@ class TopEventsJob extends job.Job {
157158
const encodedData = this.encodeEvents(data);
158159
const timeSecond = this.timeSecond();
159160
const currentPeriood = this.mutatePeriod(period);
160-
await new Promise((res, rej) => common.db.collection(TopEventsJob.COLLECTION_NAME).insert({ app_id: _id, ts: timeSecond, period: currentPeriood, data: encodedData, totalCount: totalCount, prevTotalCount: prevTotalCount, totalSum: totalSum, prevTotalSum: prevTotalSum, totalDuration: totalDuration, prevTotalDuration: prevTotalDuration, prevSessionCount: sessionData.prevSessionCount, totalSessionCount: sessionData.totalSessionCount, prevUsersCount: usersData.prevUsersCount, totalUsersCount: usersData.totalUsersCount }, (error, records) => !error && records ? res(records) : rej(error)));
161+
await new Promise((res, rej) => common.db.collection(TopEventsJob.COLLECTION_NAME).findOneAndReplace(
162+
{
163+
app_id: _id, period: currentPeriood,
164+
},
165+
{
166+
app_id: _id, ts: timeSecond, period: currentPeriood, data: encodedData, totalCount: totalCount, prevTotalCount: prevTotalCount, totalSum: totalSum, prevTotalSum: prevTotalSum, totalDuration: totalDuration, prevTotalDuration: prevTotalDuration, prevSessionCount: sessionData.prevSessionCount, totalSessionCount: sessionData.totalSessionCount, prevUsersCount: usersData.prevUsersCount, totalUsersCount: usersData.totalUsersCount
167+
},
168+
{
169+
upsert: true
170+
},
171+
(error, records) => !error && records ? res(records) : rej(error))
172+
);
161173
}
162174

163175
/**
@@ -169,7 +181,6 @@ class TopEventsJob extends job.Job {
169181
const getEvents = await new Promise((res, rej) => common.db.collection("events").findOne({ _id: app._id }, (errorEvents, result) => errorEvents ? rej(errorEvents) : res(result)));
170182
if (getEvents && 'list' in getEvents) {
171183
const eventMap = this.eventsFilter(getEvents.list);
172-
await new Promise((res, rej) => common.db.collection(TopEventsJob.COLLECTION_NAME).remove({ app_id: app._id }, (error, result) => error ? rej(error) : res(result)));
173184
if (eventMap && eventMap instanceof Array) {
174185
for (const period of TopEventsJob.PERIODS) {
175186
const data = {};
@@ -211,9 +222,14 @@ class TopEventsJob extends job.Job {
211222
* @param {Db} db connection
212223
* @param {done} done callback
213224
*/
214-
run(db, done) {
215-
this.init();
216-
done();
225+
async run(db, done) {
226+
try {
227+
await this.init();
228+
done();
229+
}
230+
catch (error) {
231+
done(error);
232+
}
217233
}
218234
}
219235

plugins/push/api/send/platforms/i.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ class APN extends Base {
708708
status = headers[':status'];
709709
// self.log.d('%d: status %d: %j', i, status, self.session.state);
710710
if (status === 200) {
711-
const apnsUniqueId = headers["apns-unique-id"];
711+
const apnsUniqueId = headers["apns-id"] ?? headers["apns-unique-id"];
712712
oks.push({ p: p._id, r: apnsUniqueId });
713713
stream.destroy();
714714
streamDone();

0 commit comments

Comments
 (0)