-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Parse.Object.saveAll() does not propagate sessionToken for all objects being saved #3665
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
Comments
Do you have server logs when running with VERBOSE=1 please? |
Here are what I think are the relevant parts. Let me know if you're looking for something else. Request
Response
Extra InfoIn case it helps, I should also mention that the context is that this is executing from within a cloud function (Parse.Cloud.define()) |
Same here. I tried parse-server 2.3.2 and 2.3.7. I didn't use cloud code, just created a https server with databaseURI assigned to 'mongoldb://localhost:27017/parse' save/saveEventually works fine for each one, but saveAll will save the first one and report 'Object not found' for others. |
Whoops, sorry, made my previous (deleted) comment without reading the second part of your test :) My only additional thought is that in my specific case, the ACL I'm relying on is for a Role, so maybe the bug is Role-specific? |
Ah so you have a role then, not an ACL for a particular user right? |
Yeah, to be even more precise, in my specific repro, the ACL allows permissions for role X and user Y, and the session token (that doesn't seem to get propagated correctly) is for user Z who has role X. |
Updated the test, with User A with Role 'admin', and objects with role read/write, and still no issue. Even with an additional user having R/W on it. |
I think the only difference left in my case is that the ACL also has read/write permission (for a user other than user A, in addition to the Role read/write permission), so perhaps that could somehow be causing an issue? But if that doesn't cause a repro, I'm out of ideas as to why I see it but you don't :-/ |
Do you have Class Level permissions or something else? Again, if you could post a gist with example data, that would help. I can confirm the session token is properly passed through, and propagated. The full auth state from the original request is actually propagated to the batch'd elements. |
Yes, I do indeed have class permissions (public can Create only, Admin role can full read/write, 'user' pointer column can full read/write) |
OK, I'll try to replicate with CLP |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
When calling Parse.Object.saveAll(array, {sessionToken: request.user.getSessionToken()}), only the first object would be saved successfully, while later objects would encounter an 'Object not found' error.
If I instead do a Parse.Promise.when where I save each object individually with the sessionToken, it works fine. Another workaround is using {useMasterKey: true} instead of the session token.
Neither of these workarounds should be necessary though.
The text was updated successfully, but these errors were encountered: