-
-
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
Open
RahulLanjewar93
wants to merge
7
commits into
parse-community:alpha
Choose a base branch
from
RahulLanjewar93:fix-issue-with-liveQuery-contains-and-matchesQuery
base: alpha
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
512fb93
chore: failing test case
RahulLanjewar93 bcc0fb3
fix: minor fix
RahulLanjewar93 2cc8222
actual fix
RahulLanjewar93 7e39947
remove fits
RahulLanjewar93 5d588e4
Merge remote-tracking branch 'upstream/alpha' into fix-issue-with-liv…
RahulLanjewar93 d7183df
Merge branch 'alpha' into fix-issue-with-liveQuery-contains-and-match…
mtrezza a86e19a
Merge branch 'alpha' into fix-issue-with-liveQuery-contains-and-match…
mtrezza File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); | ||
|
||
fit('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 | ||
const object1 = new TestObject(); | ||
object1.set('childs', [child3]); | ||
await object1.save(); | ||
}); | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
fit('Live query should work if we set equalTo(someKey,someParseObject) and new Parse object is created but someKey = null', async () => { | ||
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 |
||
}); | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
RahulLanjewar93 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Add
expect
, presumablyawait expectAsync(...).toBeResolved();
?