User setProperty not storing custom objects

Swift SDK 5.7.15

User property won’t store a custom object. If you create relation and autoload it will show up, but trying to set property won’t store it.

test.zip (473.5 KB)

The internal ticket BKNDLSS-21446 is created.

Regards,
Olha

Is there an ETA for this? I have a work around, but burns 2 API calls.

It is already fixed but requires some more tests and will be available soon.

Regards,
Olha

Could you please check with v5.7.16?

This bug looks like it has re appeared? I updated the test project here.
Create contact
Login
Set Relation

The contact is there,
if you re run, and check for the contact it is missing.
test.zip (666.9 KB)

Hello @robert-j

I’ve created an internal ticket(BKNDLSS-25279) to investigate your issue.

Regards, Dima.

Hello @robert-j,

Swift-SDK loads currentUser from server every time the app restarts, but loads it without any relations to simplify the response. For now I can advice you to use the loadRelations() method for the currentUser. I’ve created the discussion ticket BKNDLSS-25420 to investigate the possibility of loading all relations for currentUser.

Regards,
Olha

Thanks,
where in the lifecycle does the currentUser get refreshed? i.e when do i call load relations to help ensure sure there is never a nil

Current user is refreshed every time you restart the app (a new session begins) when you call the Backendless.shared.userService.currentUser.
E.g. you can load relations after calling the get current user method the first time when app restarts with stayLoggedIn = true.

Regards,
Olha