Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/alpha' into alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
mtrezza committed Jun 17, 2024
2 parents 71bf464 + 162c07b commit 7d275be
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 4 deletions.
7 changes: 7 additions & 0 deletions changelogs/CHANGELOG_alpha.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# [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)


### Bug Fixes

* 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.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)


Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "parse-server",
"version": "7.1.0-alpha.9",
"version": "7.1.0-alpha.10",
"description": "An express module providing a Parse-compatible API server",
"main": "lib/index.js",
"repository": {
Expand Down
29 changes: 29 additions & 0 deletions spec/ParseLiveQuery.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1269,4 +1269,33 @@ describe('ParseLiveQuery', function () {
expect(object2.id).toBeDefined();
expect(object3.id).toBeDefined();
});

it('triggers query event with constraint not equal to null', async () => {
await reconfigureServer({
liveQuery: {
classNames: ['TestObject'],
},
startLiveQueryServer: true,
verbose: false,
silent: true,
});

const spy = {
create(obj) {
expect(obj.attributes.foo).toEqual('bar');
},
};
const createSpy = spyOn(spy, 'create');
const query = new Parse.Query(TestObject);
query.notEqualTo('foo', null);
const subscription = await query.subscribe();
subscription.on('create', spy.create);

const object1 = new TestObject();
object1.set('foo', 'bar');
await object1.save();

await new Promise(resolve => setTimeout(resolve, 100));
expect(createSpy).toHaveBeenCalledTimes(1);
});
});
2 changes: 1 addition & 1 deletion src/LiveQuery/QueryTools.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ function matchesKeyConstraints(object, key, constraints) {
// More complex cases
for (var condition in constraints) {
compareTo = constraints[condition];
if (compareTo.__type) {
if (compareTo?.__type) {
compareTo = Parse._decode(key, compareTo);
}
switch (condition) {
Expand Down

0 comments on commit 7d275be

Please sign in to comment.