From e151cc319d2342112cc137c1e7384b7eccdf480d Mon Sep 17 00:00:00 2001 From: Diamond Lewis Date: Sat, 20 Feb 2021 14:14:53 -0600 Subject: [PATCH 1/2] Ensure pushStatus is properly running --- spec/PushWorker.spec.js | 2 ++ src/StatusHandler.js | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/spec/PushWorker.spec.js b/spec/PushWorker.spec.js index 6f9852091b..422cdf592a 100644 --- a/spec/PushWorker.spec.js +++ b/spec/PushWorker.spec.js @@ -314,6 +314,7 @@ describe('PushWorker', () => { amount: 1, }, count: { __op: 'Increment', amount: -1 }, + status: 'running', }); const query = new Parse.Query('_PushStatus'); return query.get(handler.objectId, { useMasterKey: true }); @@ -409,6 +410,7 @@ describe('PushWorker', () => { amount: 1, }, count: { __op: 'Increment', amount: -1 }, + status: 'running', }); done(); }); diff --git a/src/StatusHandler.js b/src/StatusHandler.js index 45010f3847..69b5af880e 100644 --- a/src/StatusHandler.js +++ b/src/StatusHandler.js @@ -295,9 +295,8 @@ export function pushStatusHandler(config, existingObjectId) { } ); } - - // indicate this batch is complete incrementOp(update, 'count', -1); + update.status = 'running'; return handler.update({ objectId }, update).then(res => { if (res && res.count === 0) { From a3d3931f8096c6ee7f1bad38e86c0b2032d1db50 Mon Sep 17 00:00:00 2001 From: Diamond Lewis Date: Sat, 20 Feb 2021 14:51:41 -0600 Subject: [PATCH 2/2] remove duplicate test --- spec/PushController.spec.js | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/spec/PushController.spec.js b/spec/PushController.spec.js index 2468ab2123..251f242230 100644 --- a/spec/PushController.spec.js +++ b/spec/PushController.spec.js @@ -79,19 +79,6 @@ describe('PushController', () => { done(); }); - it('can throw on validateDeviceType when single invalid device type is set', done => { - // Make query condition - const where = { - deviceType: 'osx', - }; - const validPushTypes = ['ios', 'android']; - - expect(function () { - validatePushType(where, validPushTypes); - }).toThrow(); - done(); - }); - it('can get expiration time in string format', done => { // Make mock request const timeStr = '2015-03-19T22:05:08Z';