Hi, I’m aware of several other threads relating to the server.processing exception during method invocation issue. Most of those issues were related to people not adding relations in the new way required in 4.x. I have a different issue in that I’m getting this fault when trying to save an existing object.
I shouldn’t have to do a setrelation again on an existing object do I? I really hope not because that would seem extremely backwards to me.
Steps to reproduce:
Save object that has a 1:1 relation with BackendlessUser
2 ) Set the relation after saving the object
Save the existing object with the user relation set (just save with the object you get from a find)
Currently, if I go and set the user field to nil right before I save the existing object again, it goes through and I have to do another setrelation again. This is definitely a dangerous workaround as now one step save has turned into 2 where if something happens to the network in between, I’ll potentially have an orphaned object with no user relation.
Since the version 4 was released you have to set relations between tables using separate methods (setRelation, addRelation, deleteRelation). It is the only way to manage relations. Here you can find the documentation.
Yes that’s correct Ilya, thanks. I wanted to clarify what exactly is the proper way to handle this or basically how it was designed to work in the first place, so I can understand what the right way is going about it or if this is an actual bug.
The system is designed to complete ignore any related properties when you either initially save an object or update an existing object. All operations managing the state of a relation are done exclusively via dedicated methods (add/set/removeRelation).
Thanks for the testing Olga, I’ve been banging my head against my screen and can’t figure out why this is happening.
I created a new table Post specifically to test against this. I ended up making it almost mirror the schema of the other table that has been giving me the fault. I run the following code below and for the Post class it goes through fine, but for the Shorti class it gives me the fault. Can you verify if you see the same thing? And what would make one fault and the other not when the schema’s are identical?
You can test against my app: 08D73C6A-C7AB-BAD9-FFEA-DBFAAD5AEA00 I’ve attached the Shorti and Post classes I’m using.
We’ve investigated the problem and found that it’s related to the object with cyclic relations being sent to the afterFind handler. The task with ID BKNDLSS-15799 has been created and we’ll get back to you when we have any further news.