-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
fix: LiveQuery throws on create
event using Parse.Query.containedIn
with null
value in array or using Parse.Query.equalTo
for Parse.Object
with key value null
#9744
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: alpha
Are you sure you want to change the base?
Changes from all commits
512fb93
bcc0fb3
2cc8222
7e39947
5d588e4
d7183df
a86e19a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -1308,4 +1308,59 @@ describe('ParseLiveQuery', function () { | |||||
await new Promise(resolve => setTimeout(resolve, 100)); | ||||||
expect(createSpy).toHaveBeenCalledTimes(1); | ||||||
}); | ||||||
|
||||||
it('Live query should work if needle is ParsePointer and haystack is any[], checking QueryTools.js>contains', async () => { | ||||||
await reconfigureServer({ | ||||||
liveQuery: { | ||||||
classNames: ['TestObject'], | ||||||
}, | ||||||
startLiveQueryServer: true, | ||||||
verbose: false, | ||||||
silent: true, | ||||||
}); | ||||||
|
||||||
const child1 = new Parse.Object('Child'); | ||||||
await child1.save(); | ||||||
const child2 = new Parse.Object('Child'); | ||||||
await child2.save(); | ||||||
const child3 = new Parse.Object('Child'); | ||||||
await child3.save(); | ||||||
|
||||||
const query = new Parse.Query(TestObject); | ||||||
query.containedIn('childs', [child1, child2, null]); | ||||||
|
||||||
const subscription = await query.subscribe(); | ||||||
subscription.on('create', () => {}); | ||||||
|
||||||
// Do not need any expect block, just make sure that the server doesn't crash or throw error | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add |
||||||
const object1 = new TestObject(); | ||||||
object1.set('childs', [child3]); | ||||||
await object1.save(); | ||||||
}); | ||||||
|
||||||
|
||||||
it('Live query should work if we set equalTo(someKey,someParseObject) and new Parse object is created but someKey = null', async () => { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Test descriptions should be more concise, see others for examples. If there is anything important that requires a longer explanation you could add a comment block inside the test.
Suggested change
|
||||||
await reconfigureServer({ | ||||||
liveQuery: { | ||||||
classNames: ['TestObject'], | ||||||
}, | ||||||
startLiveQueryServer: true, | ||||||
verbose: false, | ||||||
silent: true, | ||||||
}); | ||||||
|
||||||
const child = new Parse.Object('Child'); | ||||||
await child.save(); | ||||||
|
||||||
const query = new Parse.Query(TestObject); | ||||||
query.equalTo('child', child); | ||||||
|
||||||
const subscription = await query.subscribe(); | ||||||
subscription.on('create', () => {}); | ||||||
|
||||||
// Do not need any expect block, just make sure that the server doesn't crash or throw error | ||||||
const object1 = new TestObject(); | ||||||
object1.set('child', null); | ||||||
await object1.save(); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add |
||||||
}); | ||||||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more concise test description