Sync: linked entries are not returned once the entity has been changed
- Update one field of entry which has linked entries
- sync with proper token
- sync result: 1 entry changed - as expected
- entry has 0 linked entries - not expected
- raw field holds proper information
version of lib: 10.4.3
Check screenshot attached.
That exact issue occurs in ResourceUtils func resolveArrayOfLinks line 118. The lib tries to load linked resource from current fetched (synced) items - which obviously can't work!
Edit: Not only resolveArrayOfLinks - every not initial sync which uses link resolution that way is broken.
@drezzzik @lechld Thanks for spotting that, we will try to fix it in the next release.
We also observe (probably related?) anomaly when using cdaClient.sync(syncToken) API (we don't observe this problem when using cdaClient.sync(oldSyncSpace) API.
As far as I understand, cdaClient.sync(oldSyncSpace) API might eventually produce syncSpace that contains ALL space's contents (i.e. keep whole DB copy in heap 🙂 ), this is the reason we try to rely on cdaClient.sync(syncToken).
Scenario:
- create parent object of type Shelf with property "books" that is a list of children objects of type Book. Let our list contain just one book for now.
- unpublish Shelf object (parent).
- make 1st sync (full sync) - SynchronizedSpace.items[0] shall contain our Book (that is ok, because Shelf object is effectively not visible to external world, but the Book object is).
- publish Shelf object (parent).
- BUG: make 2nd sync (using token of the 1st sync). SynchronizedSpace.items shall contain Shelf object (it became published), however its "books" property will be empty. So we never get a fact that Book child object is sitting within parent Shelf. Note, that incoming Shelf object does contain link to the Book in SynchronizedSpace.items[0].rawFields.books...sys field, book is just not getting resolved by SDK - it does not appear within SynchronizedSpace.items[0].fields.books .