-
-
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
Saving a relation on a User object with beforeSave causes the response to contain a relation op instead of a relation #1606
Comments
Instead of using |
Hi @flovilmart , thanks for the quick response. As far as I can tell, I'm not using I've edited the issue to be clearer about where the code is run. |
Has anyone reading this been able to reproduce this issue? |
@omyen I have! Ran into a similar thing from the iOS SDK as well: parse-community/Parse-SDK-iOS-OSX#911 |
@peeinears Thanks for the reply - I've "resolved" this issue by |
@omyen Thanks, yep I've been doing the same thing. |
@peeinears Actually, I'm curious - I could only repro this issue on objects with a |
Misclicked close |
@omyen I've only noticed it on objects with |
@omyen I'm experiencing the same issue, but removing the The issue appears to be isolated to relations on Parse.User.current(); I am not seeing it on other objects. |
Can a Parse Pro please confirm that the relation operation should not be in the save response? |
I'm working right now on something similar, I'll post a fix in #1946 |
@flovilmart Awesome, thanks! In the meantime, I just hacked together this monkeypatch to avoid having to var originalRelation = Parse.Object.prototype.relation;
Parse.Object.prototype.relation = function (attr) {
if (this.get(attr) instanceof Parse.Op.Relation) {
return new Parse.Relation(this, attr);
}
return originalRelation.apply(this, arguments);
}; |
@peeinears nice patch! But the PR should be merged soon, as soon as we're ready for 2.2.17, you'll be able to remove it :) |
…ons to SDKs (#1946) * Adding a test demonstrating issue #1840. * Fixes #1840 * Adds failing test with other use case - That test fails on parse.com as well * Bumps parse to 1.9.0 * exclude pg db * Exclude pg on other test * Adds clientSDK compatibility check for forward deletion - Mark js1.9.0 as compatible * Strips all operations from result - fix for #1606
… delete operations to SDKs (parse-community#1946) * Adding a test demonstrating issue parse-community#1840. * Fixes parse-community#1840 * Adds failing test with other use case - That test fails on parse.com as well * Bumps parse to 1.9.0 * exclude pg db * Exclude pg on other test * Adds clientSDK compatibility check for forward deletion - Mark js1.9.0 as compatible * Strips all operations from result - fix for parse-community#1606
… delete operations to SDKs (parse-community#1946) * Adding a test demonstrating issue parse-community#1840. * Fixes parse-community#1840 * Adds failing test with other use case - That test fails on parse.com as well * Bumps parse to 1.9.0 * exclude pg db * Exclude pg on other test * Adds clientSDK compatibility check for forward deletion - Mark js1.9.0 as compatible * Strips all operations from result - fix for parse-community#1606
Check out this issue for an ideal bug report. The closer your issue report is to that one, the more likely we are to be able to help, and the more likely we will be to fix the issue quickly!
For implementation related questions or technical support, please refer to the Stack Overflow and Server Fault communities.
Make sure these boxes are checked before submitting your issue -- thanks for reporting issues back to Parse Server!
Environment Setup
It's unlikely you'll need to match this setup exactly to reproduce this issue, but included for completeness:
Steps to reproduce
'_User'
instead ofParse.User
):Logs/Trace
var errorHere = result.relation('tests');
you can see the following inside the attributes of theresult
objectAddRelation
op:This also seems to happen to other objects with relations and beforeSave functions, but I can't reliably reproduce it for anything other than a User.
The text was updated successfully, but these errors were encountered: