Skip to content

Commit f1394a9

Browse files
authored
Ensure pushStatus is properly running (#7213)
* Ensure pushStatus is properly running * remove duplicate test
1 parent a649a9e commit f1394a9

File tree

3 files changed

+3
-15
lines changed

3 files changed

+3
-15
lines changed

spec/PushController.spec.js

-13
Original file line numberDiff line numberDiff line change
@@ -79,19 +79,6 @@ describe('PushController', () => {
7979
done();
8080
});
8181

82-
it('can throw on validateDeviceType when single invalid device type is set', done => {
83-
// Make query condition
84-
const where = {
85-
deviceType: 'osx',
86-
};
87-
const validPushTypes = ['ios', 'android'];
88-
89-
expect(function () {
90-
validatePushType(where, validPushTypes);
91-
}).toThrow();
92-
done();
93-
});
94-
9582
it('can get expiration time in string format', done => {
9683
// Make mock request
9784
const timeStr = '2015-03-19T22:05:08Z';

spec/PushWorker.spec.js

+2
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ describe('PushWorker', () => {
314314
amount: 1,
315315
},
316316
count: { __op: 'Increment', amount: -1 },
317+
status: 'running',
317318
});
318319
const query = new Parse.Query('_PushStatus');
319320
return query.get(handler.objectId, { useMasterKey: true });
@@ -409,6 +410,7 @@ describe('PushWorker', () => {
409410
amount: 1,
410411
},
411412
count: { __op: 'Increment', amount: -1 },
413+
status: 'running',
412414
});
413415
done();
414416
});

src/StatusHandler.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -295,9 +295,8 @@ export function pushStatusHandler(config, existingObjectId) {
295295
}
296296
);
297297
}
298-
299-
// indicate this batch is complete
300298
incrementOp(update, 'count', -1);
299+
update.status = 'running';
301300

302301
return handler.update({ objectId }, update).then(res => {
303302
if (res && res.count === 0) {

0 commit comments

Comments
 (0)