Simperium/simperium-ios

Sync error when updating a relationship from another device

Opened this issue · 4 comments

2 entities: Entity1 and Entity2
Entity1 has a 1 to many relationships to Entity2
If an object A of type Entity2 points to an object B of type Entity1, then we make A points to another objectC of type Entity1 in a single operation (without nullifying in between), then an error is logged on other devices

            SPLogError(@"Simperium error: member %@ from diff wasn't in change", key);

Problem is the change being received is a diff of the simperium key string for that relationship

{
o = d;
v = "-32\t+18567dcee3074f78b24def6ffc039904";
}

but SPMemberEntity expects the value to be the Simperium key itself, not a diff

I assume a workaround is to modify the schema to force a replace of those values instead of a diff, the same way we do with Transformables. However, you might still want to consider this a bug

Bump, any update on this guys?

Sorry @danieljimenez, low priority (for now). Please, consider enabling the Replace schema option, as outlined by JP, at least for now. Other than that, patches are always welcome.

Thank you, hope you're doing great!

We just wanted to make sure that was the right approach, thanks!

I'm afraid that, for now, yes sir, that would be the right approach. Thanks for checking (and apologies about missing this ticket!)