Skip to content
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

LiveQuery constrains matching fix #2357

Merged
merged 7 commits into from
Jul 23, 2016

Conversation

simonas-notcat
Copy link
Contributor

When constrains == null, we get “Uncaught internal server error”

Uncaught internal server error. TypeError: Cannot read property '__type' of null
at matchesKeyConstraints (/project/node_modules/parse-server/lib/LiveQuery/QueryTools.js:143:18)
at matchesQuery (/project/node_modules/parse-server/lib/LiveQuery/QueryTools.js:111:10)
at ParseLiveQueryServer._matchesSubscription (/project/node_modules/parse-server/lib/LiveQuery/ParseLiveQueryServer.js:536:43)
at _loop3 (/project/node_modules/parse-server/lib/LiveQuery/ParseLiveQueryServer.js:310:53)
at ParseLiveQueryServer._onAfterSave (/project/node_modules/parse-server/lib/LiveQuery/ParseLiveQueryServer.js:422:11)
at Subscriber. (/project/node_modules/parse-server/lib/LiveQuery/ParseLiveQueryServer.js:118:15)
at emitTwo (events.js:106:13)
at Subscriber.emit (events.js:191:7)
at EventEmitter.handler (/project/node_modules/parse-server/lib/LiveQuery/EventEmitterPubSub.js:60:16)
at emitOne (events.js:96:13)
at EventEmitter.emit (events.js:188:7) TypeError: Cannot read property '__type' of null
at matchesKeyConstraints (/project/node_modules/parse-server/lib/LiveQuery/QueryTools.js:143:18)
at matchesQuery (/project/node_modules/parse-server/lib/LiveQuery/QueryTools.js:111:10)
at ParseLiveQueryServer._matchesSubscription (/project/node_modules/parse-server/lib/LiveQuery/ParseLiveQueryServer.js:536:43)
at _loop3 (/project/node_modules/parse-server/lib/LiveQuery/ParseLiveQueryServer.js:310:53)
at ParseLiveQueryServer._onAfterSave (/project/node_modules/parse-server/lib/LiveQuery/ParseLiveQueryServer.js:422:11)
at Subscriber. (/project/node_modules/parse-server/lib/LiveQuery/ParseLiveQueryServer.js:118:15)
at emitTwo (events.js:106:13)
at Subscriber.emit (events.js:191:7)
at EventEmitter.handler (/project/node_modules/parse-server/lib/LiveQuery/EventEmitterPubSub.js:60:16)
at emitOne (events.js:96:13)
at EventEmitter.emit (events.js:188:7)

…uery

This bug caused sessionToken to be replaced on client side to some old
sessionToken from DB.
If there is a liveQuery subscription, with Pointer type constrains (e.g
query.equalTo('user', Parse.User.current())), and new object has
undefined value for that field, we get this error:

    error: Uncaught internal server error. [TypeError: Cannot read
property 'className' of undefined] TypeError: Cannot read property
'className' of undefined
    at matchesKeyConstraints
(…/node_modules/parse-server/lib/LiveQuery/QueryTools.js:145:51)
When constrains == null, we get “Uncaught internal server error”
@codecov-io
Copy link

codecov-io commented Jul 22, 2016

Current coverage is 91.80% (diff: 100%)

Merging #2357 into master will decrease coverage by <.01%

@@             master      #2357   diff @@
==========================================
  Files            94         94          
  Lines         10479      10483     +4   
  Methods        1275       1275          
  Messages          0          0          
  Branches       1713       1714     +1   
==========================================
+ Hits           9621       9624     +3   
- Misses          858        859     +1   
  Partials          0          0          

Powered by Codecov. Last update 66c4b98...7953dff

@drew-gross drew-gross merged commit 93b4117 into parse-community:master Jul 23, 2016
rsouzas pushed a commit to back4app/parse-server that referenced this pull request Mar 15, 2017
* Removing sessionToken and authData from _User objects included in a query

This bug caused sessionToken to be replaced on client side to some old
sessionToken from DB.

* Removing dangling variable that is never used

* Checking if object has defined key for Pointer constraints in liveQuery

If there is a liveQuery subscription, with Pointer type constrains (e.g
query.equalTo('user', Parse.User.current())), and new object has
undefined value for that field, we get this error:

    error: Uncaught internal server error. [TypeError: Cannot read
property 'className' of undefined] TypeError: Cannot read property
'className' of undefined
    at matchesKeyConstraints
(…/node_modules/parse-server/lib/LiveQuery/QueryTools.js:145:51)

* LiveQuery constrains matching fix

When constrains == null, we get “Uncaught internal server error”
rsouzas pushed a commit to back4app/parse-server that referenced this pull request Mar 16, 2017
* Removing sessionToken and authData from _User objects included in a query

This bug caused sessionToken to be replaced on client side to some old
sessionToken from DB.

* Removing dangling variable that is never used

* Checking if object has defined key for Pointer constraints in liveQuery

If there is a liveQuery subscription, with Pointer type constrains (e.g
query.equalTo('user', Parse.User.current())), and new object has
undefined value for that field, we get this error:

    error: Uncaught internal server error. [TypeError: Cannot read
property 'className' of undefined] TypeError: Cannot read property
'className' of undefined
    at matchesKeyConstraints
(…/node_modules/parse-server/lib/LiveQuery/QueryTools.js:145:51)

* LiveQuery constrains matching fix

When constrains == null, we get “Uncaught internal server error”
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants