relationships being deserialised to the wrong class type (iOS, swift)

Looks like I’ve found another issue with relationships in the iOS SDK. Trying to build a reproducible test case and investigate more now. The AMF received back from the server always seems to be correct (at least it looks correct in my proxy tool).

My current test project makes a find request for League and then immediately makes a findById for the single returned League. In the response for the findById it lists the Competitor relationship contents. Most of the time it works fine, but sometimes the relationship contains Game instances instead of Competitors.

When the above process is complete and a success it starts again immediately. In the last run it worked correctly 5 times and then failed. The app was doing nothing else during this test and the server wasn’t updated with any changes. There is no custom business logic in this test.

Competitor does have a relationship to Game. Pretty much all relationships are defined as auto-load so the response creates a complete object graph. The object graph shouldn’t ever be very big for this project so I’m not concerned about performance issues, I care more about simplicity in this case.

I think this is an issue in the WebOrb common library. The root of the issue seems to be in HttpEngine processAsyncAMFResponse. I’ve seen a crash in that method once that I can’t get details of. Most of the time (when there’s an issue) the response comes back malformed as described above.

I have also now seen the League returned directly as a Game instance. This was actually from the find request which in the AMF appears to correctly be an array containing a single League.

Hi Wain,

Could you provide your sample test project to support@backendless.com?

Regards,
Slava

We’ve found the solution - please update Backendless SDK from CocoaPods (3.0.17 release) or from github (CommLibiOS and backendless).

please update Backendless SDK from CocoaPods (3.0.18 release) or from github (CommLibiOS and backendless).