-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Push overhaul #4378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Push overhaul #4378
Conversation
17c8d4b
to
94a060f
Compare
94a060f
to
a74e8bd
Compare
Codecov Report
@@ Coverage Diff @@
## master #4378 +/- ##
==========================================
+ Coverage 92.77% 92.78% +<.01%
==========================================
Files 119 119
Lines 8448 8512 +64
==========================================
+ Hits 7838 7898 +60
- Misses 610 614 +4
Continue to review full report at Codecov.
|
@@ -157,6 +157,138 @@ describe('PushWorker', () => { | |||
expect(PushUtils.bodiesPerLocales({where: {}})).toEqual({default: {where: {}}}); | |||
expect(PushUtils.groupByLocaleIdentifier([])).toEqual({default: []}); | |||
}); | |||
|
|||
it('should propely apply translations strings', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo on 'propely' 😛
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
meh.. look like I'm quite tired
}); | ||
}); | ||
|
||
it('should propely apply translations objects', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again here
}); | ||
}); | ||
|
||
it('should propely override alert-lang with translations', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and here
}); | ||
}); | ||
|
||
it('should propely override alert-lang with translations strings', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
@@ -16,6 +18,7 @@ export class PushQueue { | |||
constructor(config: any = {}) { | |||
this.channel = config.channel || PushQueue.defaultPushChannel(); | |||
this.batchSize = config.batchSize || DEFAULT_BATCH_SIZE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need batchSize?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah we still need it so we have a query batch size and an enqueue batch size:
@@ -276,7 +408,6 @@ describe('PushWorker', () => { | |||
'failedPerType.ios': { __op: 'Increment', amount: 1 }, | |||
[`sentPerUTCOffset.${UTCOffset}`]: { __op: 'Increment', amount: 1 }, | |||
[`failedPerUTCOffset.${UTCOffset}`]: { __op: 'Increment', amount: 1 }, | |||
count: { __op: 'Increment', amount: -1 } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're not using count
on _PushStatus we should probably strip it from the schema as well, unless there's some particular need for it still.
@@ -2,9 +2,11 @@ import { ParseMessageQueue } from '../ParseMessageQueue'; | |||
import rest from '../rest'; | |||
import { applyDeviceTokenExists } from './utils'; | |||
import Parse from 'parse/node'; | |||
import logger from '../logger'; | |||
|
|||
const PUSH_CHANNEL = 'parse-server-push'; | |||
const DEFAULT_BATCH_SIZE = 100; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If batchSize is not needed we can just drop this too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some typos and questions. But the tests look good 👍 .
@@ -16,6 +18,7 @@ export class PushQueue { | |||
constructor(config: any = {}) { | |||
this.channel = config.channel || PushQueue.defaultPushChannel(); | |||
this.batchSize = config.batchSize || DEFAULT_BATCH_SIZE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah we still need it so we have a query batch size and an enqueue batch size:
return rest.each(config, auth, '_Installation', where, options, (result) => { | ||
total++; | ||
currentBatch.push(result.objectId); | ||
if (currentBatch.length == this.batchSize) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's used there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha.
Motivation:
translation
key support as it was originally intended on parse-dashboardThis will require to bump to 3.0.