Skip to content

Commit e610d7c

Browse files
committed
[push] Fixing unsuccessfull message compilation for highly-concurrent cases
1 parent 2d070b1 commit e610d7c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

plugins/push/api/jobs/process.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,12 @@ class ProcessJob extends J.IPCJob {
361361
}
362362

363363
// load next batch
364-
let msgs = await this.loader.load(this._id, date, BATCH);
364+
let msgs = await this.loader.load(this._id, date, BATCH),
365+
ids = msgs.map(m => m.n.toString());
366+
367+
// reload notes for msgs
368+
ids = ids.filter((id, i) => ids.indexOf(id) === i);
369+
notes = await this.loader.notes(ids);
365370

366371
// no messages left, break from the loop
367372
if (!msgs.length) {

0 commit comments

Comments
 (0)