-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Context is undefined in Cloud code beforeFind for queries using include #8759
Comments
Thanks for opening this issue!
|
Could you try the Parse Server versions in between 6.2 and 6.3, to we can pin down since when the issue was introduced? I assume it may be related to #8733, which has been released in 6.2.2. |
It works up to 6.2.1, but starting with 6.2.2 and up it has that issue. |
Could you write a filing test for this in a PR? cc @Moumouls |
PR opened :) |
🎉 This change has been released in version 6.4.0-alpha.5 |
thanks a lot @hej2010 ! |
🎉 This change has been released in version 6.5.0-beta.1 |
🎉 This change has been released in version 6.5.0-alpha.1 |
🎉 This change has been released in version 6.5.0 |
🎉 This change has been released in version 7.0.0 |
New Issue Checklist
Issue Description
I updated from Parse 6.2.0 to 6.3.0 and it appears to have changed how queries with
include(...)
are made.The
req.context
is empty inParse.Cloud.beforeFind()
when using a query withinclude()
.For a query like:
in the old version the
beforeFind
was only called once and had the specified context object.But in the latest (6.3.0) version the
beforeFind
is called twice, once for the query toPost
(with the context object) and another time for the query to_User
(with no context object and the query{"where":{"objectId":{"$in":[objectId1, objectId2, ... ]}}}
).I use the
beforeFind
to only allow queries made from the cloud code for certain classes (by using the find context), but for queries withinclude
it is no longer possible to check if the query was made from cloud code or from a client SDK.Steps to reproduce
Define beforeFind, like:
and use a query like:
Actual Outcome
The context in
beforeFind("Post", ...)
is the context object defined in the query.The context in
beforeFind(Parse.User, ...)
(or any class that is included in a query) is undefined/empty.Expected Outcome
The context is defined in both
beforeFind
functions.Environment
Server
6.3.0
Database
MongoDB
Logs
The text was updated successfully, but these errors were encountered: