Skip to content

Commit 1ed8bc7

Browse files
committed
Always merge pending ops on failure
1 parent d68f375 commit 1ed8bc7

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/ParseObject.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -353,10 +353,7 @@ export default class ParseObject {
353353

354354
_handleSaveError() {
355355
var pending = this._getPendingOps();
356-
if (pending.length > 2) {
357-
// There are more saves on the queue
358-
ObjectState.mergeFirstPendingState(this.className, this._getStateIdentifier());
359-
}
356+
ObjectState.mergeFirstPendingState(this.className, this._getStateIdentifier());
360357
}
361358

362359
/** Public methods **/

src/__tests__/ParseObject-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,7 @@ describe('ParseObject', () => {
868868
p.save().then(null, (err) => {
869869
expect(err.code).toBe(103);
870870
expect(err.message).toBe('Invalid class name');
871-
expect(p._getPendingOps().length).toBe(2);
871+
expect(p._getPendingOps().length).toBe(1);
872872
expect(p.dirtyKeys()).toEqual(['updates']);
873873
expect(p.get('updates')).toBe(1);
874874

0 commit comments

Comments
 (0)