Skip to content

Commit 0ea7c28

Browse files
authored
Merge branch 'alpha' into fix-hooks-url
2 parents cd59782 + dc03103 commit 0ea7c28

16 files changed

+427
-346
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
---
44

5-
[![Build Status CI alpha](https://github.com/parse-community/Parse-SDK-JS/workflows/ci/badge.svg?branch=alpha&subject=alpha)](https://github.com/parse-community/Parse-SDK-JS/actions?query=workflow%3Aci+branch%3Aalpha)
6-
[![Build Status CI beta](https://github.com/parse-community/Parse-SDK-JS/workflows/ci/badge.svg?branch=beta)](https://github.com/parse-community/Parse-SDK-JS/actions?query=workflow%3Aci+branch%3Abeta)
7-
[![Build Status CI release](https://github.com/parse-community/Parse-SDK-JS/workflows/ci/badge.svg?branch=release)](https://github.com/parse-community/Parse-SDK-JS/actions?query=workflow%3Aci+branch%3Arelease)
5+
[![Build Status CI alpha](https://github.com/parse-community/Parse-SDK-JS/actions/workflows/ci.yml/badge.svg?branch=alpha&subject=alpha)](https://github.com/parse-community/Parse-SDK-JS/actions?query=workflow%3Aci+branch%3Aalpha)
6+
[![Build Status CI beta](https://github.com/parse-community/Parse-SDK-JS/actions/workflows/ci.yml/badge.svg?branch=beta)](https://github.com/parse-community/Parse-SDK-JS/actions?query=workflow%3Aci+branch%3Abeta)
7+
[![Build Status CI release](https://github.com/parse-community/Parse-SDK-JS/actions/workflows/ci.yml/badge.svg?branch=release)](https://github.com/parse-community/Parse-SDK-JS/actions?query=workflow%3Aci+branch%3Arelease)
88
[![Snyk Badge](https://snyk.io/test/github/parse-community/Parse-SDK-JS/badge.svg)](https://snyk.io/test/github/parse-community/Parse-SDK-JS)
9-
[![Coverage](http://codecov.io/github/parse-community/Parse-SDK-JS/coverage.svg?branch=alpha)](http://codecov.io/github/parse-community/Parse-SDK-JS?branch=alpha)
9+
[![Coverage](https://codecov.io/gh/parse-community/Parse-SDK-JS/branch/alpha/graph/badge.svg)](https://codecov.io/gh/parse-community/Parse-SDK-JS)
1010

1111
[![Node Version](https://img.shields.io/badge/nodejs-18,_20,_22-green.svg?logo=node.js&style=flat)](https://nodejs.org/)
1212
[![auto-release](https://img.shields.io/badge/%F0%9F%9A%80-auto--release-9e34eb.svg)](https://github.com/parse-community/parse-dashboard/releases)

changelogs/CHANGELOG_alpha.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
# [6.0.0-alpha.1](https://github.com/parse-community/Parse-SDK-JS/compare/5.3.0-alpha.6...6.0.0-alpha.1) (2025-02-16)
2+
3+
4+
### Bug Fixes
5+
6+
* Remove validation error handler option `error` from various methods of `Parse.Object` ([#2445](https://github.com/parse-community/Parse-SDK-JS/issues/2445)) ([52ddaee](https://github.com/parse-community/Parse-SDK-JS/commit/52ddaee5213a0d5e5797f4130781987665fef843))
7+
8+
9+
### BREAKING CHANGES
10+
11+
* Removes the error handler option `error` from `Parse.Object.set`, `Parse.Object.setACL`, `Parse.Object.unset`, `Parse.Role.setName` and instead throws on validation error. Previously, if the `error` option was set, the handler was invoked if a validation error occurred on `Parse.Object.set`, and if no handler was set, an error was thrown on `Parse.Object.save`. The new behavior is that an error is thrown at `Parse.Object.set`. For example, instead of using `Parse.Object.set(key, value, { error: ... })` wrap `Parse.Object.set(key, value)` into a `try/catch` block. ([52ddaee](52ddaee))
12+
13+
# [5.3.0-alpha.6](https://github.com/parse-community/Parse-SDK-JS/compare/5.3.0-alpha.5...5.3.0-alpha.6) (2025-02-14)
14+
15+
16+
### Bug Fixes
17+
18+
* `Parse.Query.findAll` not returning all objects with option `json: true` ([#2449](https://github.com/parse-community/Parse-SDK-JS/issues/2449)) ([f160b8c](https://github.com/parse-community/Parse-SDK-JS/commit/f160b8c9a14ef26b850bebd0a65e84a1e96ef327))
19+
120
# [5.3.0-alpha.5](https://github.com/parse-community/Parse-SDK-JS/compare/5.3.0-alpha.4...5.3.0-alpha.5) (2025-02-11)
221

322

integration/test/ParseACLTest.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ describe('Parse.ACL', () => {
1010

1111
it('acl must be valid', () => {
1212
const user = new Parse.User();
13-
assert.equal(user.setACL(`Ceci n'est pas un ACL.`), false);
13+
expect(() => user.setACL(`Ceci n'est pas un ACL.`)).toThrow(
14+
new Parse.Error(Parse.Error.OTHER_CAUSE, 'ACL must be a Parse ACL.')
15+
);
1416
});
1517

1618
it('can refresh object with acl', async () => {

integration/test/ParseObjectTest.js

Lines changed: 45 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -546,24 +546,20 @@ describe('Parse Object', () => {
546546
});
547547
});
548548

549-
it('cannot create invalid key names', done => {
549+
it('cannot create invalid key names', async () => {
550+
const error = new Parse.Error(Parse.Error.INVALID_KEY_NAME, `Invalid key name: "foo^bar"`);
550551
const item = new Parse.Object('Item');
551-
assert(!item.set({ 'foo^bar': 'baz' }));
552-
item.save({ 'foo^bar': 'baz' }).catch(e => {
553-
assert.equal(e.code, Parse.Error.INVALID_KEY_NAME);
554-
done();
555-
});
552+
expect(() => {
553+
item.set({ 'foo^bar': 'baz' });
554+
}).toThrow(error);
555+
await expectAsync(item.save({ 'foo^bar': 'baz' })).toBeRejectedWith(error);
556556
});
557557

558558
it('cannot use invalid key names in multiple sets', () => {
559559
const item = new Parse.Object('Item');
560-
assert(
561-
!item.set({
562-
foobar: 'baz',
563-
'foo^bar': 'baz',
564-
})
565-
);
566-
assert(!item.get('foobar'));
560+
expect(() => {
561+
item.set({ foobar: 'baz', 'foo^bar': 'baz' });
562+
}).toThrow(new Parse.Error(Parse.Error.INVALID_KEY_NAME, `Invalid key name: "foo^bar"`));
567563
});
568564

569565
it('can unset fields', done => {
@@ -1135,12 +1131,43 @@ describe('Parse Object', () => {
11351131
parent.set('children', [child1, child2]);
11361132
parent.set('bastard', child3);
11371133

1138-
expect(parent.save).toThrow();
1139-
let results = await new Parse.Query(Child).find();
1140-
assert.equal(results.length, 0);
1141-
11421134
await parent.save(null, { cascadeSave: true });
1143-
results = await new Parse.Query(Child).find();
1135+
const results = await new Parse.Query(Child).find();
1136+
assert.equal(results.length, 3);
1137+
1138+
parent.set('dead', true);
1139+
child1.set('dead', true);
1140+
await parent.save(null);
1141+
const rob = await new Parse.Query(Child).equalTo('name', 'rob').first();
1142+
expect(rob.get('dead')).toBe(true);
1143+
1144+
parent.set('lastname', 'stark');
1145+
child3.set('lastname', 'stark');
1146+
await parent.save(null, { cascadeSave: false });
1147+
const john = await new Parse.Query(Child).doesNotExist('lastname').first();
1148+
expect(john.get('lastname')).toBeUndefined();
1149+
});
1150+
1151+
it('can skip cascade (default true) saving as per request', async () => {
1152+
const Parent = Parse.Object.extend('Parent');
1153+
const Child = Parse.Object.extend('Child');
1154+
1155+
const parent = new Parent();
1156+
const child1 = new Child();
1157+
const child2 = new Child();
1158+
const child3 = new Child();
1159+
1160+
child1.set('name', 'rob');
1161+
child2.set('name', 'sansa');
1162+
child3.set('name', 'john');
1163+
parent.set('children', [child1, child2]);
1164+
parent.set('bastard', child3);
1165+
1166+
// cascadeSave option default true
1167+
await parent.save(null, {
1168+
/* cascadeSave: true */
1169+
});
1170+
const results = await new Parse.Query(Child).find();
11441171
assert.equal(results.length, 3);
11451172

11461173
parent.set('dead', true);

integration/test/ParseQueryTest.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1493,13 +1493,17 @@ describe('Parse Query', () => {
14931493

14941494
it('can return all objects with findAll', async () => {
14951495
const objs = [...Array(101)].map(() => new Parse.Object('Container'));
1496-
14971496
await Parse.Object.saveAll(objs);
1498-
14991497
const query = new Parse.Query('Container');
1500-
15011498
const result = await query.findAll();
1499+
assert.equal(result.length, 101);
1500+
});
15021501

1502+
it('can return all objects with findAll json option', async () => {
1503+
const objs = [...Array(101)].map(() => new Parse.Object('Container'));
1504+
await Parse.Object.saveAll(objs);
1505+
const query = new Parse.Query('Container');
1506+
const result = await query.findAll({ json: true, batchSize: 100 });
15031507
assert.equal(result.length, 101);
15041508
});
15051509

0 commit comments

Comments
 (0)