Skip to content

Commit 7d275be

Browse files
committed
Merge remote-tracking branch 'upstream/alpha' into alpha
2 parents 71bf464 + 162c07b commit 7d275be

File tree

5 files changed

+40
-4
lines changed

5 files changed

+40
-4
lines changed

changelogs/CHANGELOG_alpha.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# [7.1.0-alpha.10](https://github.com/parse-community/parse-server/compare/7.1.0-alpha.9...7.1.0-alpha.10) (2024-06-11)
2+
3+
4+
### Bug Fixes
5+
6+
* Live query throws error when constraint `notEqualTo` is set to `null` ([#8835](https://github.com/parse-community/parse-server/issues/8835)) ([11d3e48](https://github.com/parse-community/parse-server/commit/11d3e484df862224c15d20f6171514948981ea90))
7+
18
# [7.1.0-alpha.9](https://github.com/parse-community/parse-server/compare/7.1.0-alpha.8...7.1.0-alpha.9) (2024-05-27)
29

310

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "parse-server",
3-
"version": "7.1.0-alpha.9",
3+
"version": "7.1.0-alpha.10",
44
"description": "An express module providing a Parse-compatible API server",
55
"main": "lib/index.js",
66
"repository": {

spec/ParseLiveQuery.spec.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,4 +1269,33 @@ describe('ParseLiveQuery', function () {
12691269
expect(object2.id).toBeDefined();
12701270
expect(object3.id).toBeDefined();
12711271
});
1272+
1273+
it('triggers query event with constraint not equal to null', async () => {
1274+
await reconfigureServer({
1275+
liveQuery: {
1276+
classNames: ['TestObject'],
1277+
},
1278+
startLiveQueryServer: true,
1279+
verbose: false,
1280+
silent: true,
1281+
});
1282+
1283+
const spy = {
1284+
create(obj) {
1285+
expect(obj.attributes.foo).toEqual('bar');
1286+
},
1287+
};
1288+
const createSpy = spyOn(spy, 'create');
1289+
const query = new Parse.Query(TestObject);
1290+
query.notEqualTo('foo', null);
1291+
const subscription = await query.subscribe();
1292+
subscription.on('create', spy.create);
1293+
1294+
const object1 = new TestObject();
1295+
object1.set('foo', 'bar');
1296+
await object1.save();
1297+
1298+
await new Promise(resolve => setTimeout(resolve, 100));
1299+
expect(createSpy).toHaveBeenCalledTimes(1);
1300+
});
12721301
});

src/LiveQuery/QueryTools.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ function matchesKeyConstraints(object, key, constraints) {
223223
// More complex cases
224224
for (var condition in constraints) {
225225
compareTo = constraints[condition];
226-
if (compareTo.__type) {
226+
if (compareTo?.__type) {
227227
compareTo = Parse._decode(key, compareTo);
228228
}
229229
switch (condition) {

0 commit comments

Comments
 (0)