{"action":"created","issue":{"url":"https://api.github.com/repos/contentful/contentful-persistence.swift/issues/58","repository_url":"https://api.github.com/repos/contentful/contentful-persistence.swift","labels_url":"https://api.github.com/repos/contentful/contentful-persistence.swift/issues/58/labels{/name}","comments_url":"https://api.github.com/repos/contentful/contentful-persistence.swift/issues/58/comments","events_url":"https://api.github.com/repos/contentful/contentful-persistence.swift/issues/58/events","html_url":"https://github.com/contentful/contentful-persistence.swift/issues/58","id":328558798,"node_id":"MDU6SXNzdWUzMjg1NTg3OTg=","number":58,"title":"Missing relationships between entries","user":{"login":"marcin-bo","id":26303487,"node_id":"MDQ6VXNlcjI2MzAzNDg3","avatar_url":"https://avatars2.githubusercontent.com/u/26303487?v=4","gravatar_id":"","url":"https://api.github.com/users/marcin-bo","html_url":"https://github.com/marcin-bo","followers_url":"https://api.github.com/users/marcin-bo/followers","following_url":"https://api.github.com/users/marcin-bo/following{/other_user}","gists_url":"https://api.github.com/users/marcin-bo/gists{/gist_id}","starred_url":"https://api.github.com/users/marcin-bo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcin-bo/subscriptions","organizations_url":"https://api.github.com/users/marcin-bo/orgs","repos_url":"https://api.github.com/users/marcin-bo/repos","events_url":"https://api.github.com/users/marcin-bo/events{/privacy}","received_events_url":"https://api.github.com/users/marcin-bo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-06-01T15:14:35Z","updated_at":"2018-06-19T10:37:03Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nWe experience issues with missing relationships between entries. \r\n\r\nOur sync request has many pages and it takes around one minute to download and save all entries in our database. If user quits the app in the middle of synchronization we loose some relationships between entries. They are not recreated even after restarting the application and completing the data synchronization process. \r\n\r\nWhen I do not interrupt the data synchronization process and wait one minute to sync all data, the relationships appear in the database.\r\n\r\nProbably the problem is with `resolveRelationships()` function: it stores those missing relationships in `relationshipsToResolve` property in memory and after quiting the app we loose the content of it. Is it possible?\r\n\r\nI reported similar issue few months ago #47 (when seeding database).\r\n\r\nCheers!"},"comment":{"url":"https://api.github.com/repos/contentful/contentful-persistence.swift/issues/comments/398354249","html_url":"https://github.com/contentful/contentful-persistence.swift/issues/58#issuecomment-398354249","issue_url":"https://api.github.com/repos/contentful/contentful-persistence.swift/issues/58","id":398354249,"node_id":"MDEyOklzc3VlQ29tbWVudDM5ODM1NDI0OQ==","user":{"login":"marcin-bo","id":26303487,"node_id":"MDQ6VXNlcjI2MzAzNDg3","avatar_url":"https://avatars2.githubusercontent.com/u/26303487?v=4","gravatar_id":"","url":"https://api.github.com/users/marcin-bo","html_url":"https://github.com/marcin-bo","followers_url":"https://api.github.com/users/marcin-bo/followers","following_url":"https://api.github.com/users/marcin-bo/following{/other_user}","gists_url":"https://api.github.com/users/marcin-bo/gists{/gist_id}","starred_url":"https://api.github.com/users/marcin-bo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcin-bo/subscriptions","organizations_url":"https://api.github.com/users/marcin-bo/orgs","repos_url":"https://api.github.com/users/marcin-bo/repos","events_url":"https://api.github.com/users/marcin-bo/events{/privacy}","received_events_url":"https://api.github.com/users/marcin-bo/received_events","type":"User","site_admin":false},"created_at":"2018-06-19T10:37:03Z","updated_at":"2018-06-19T10:37:03Z","author_association":"NONE","body":"Hi, \r\n\r\nI haven't add any custom logic in `applicationWillTerminate(_:)`. That could be wrong because when user quits the app after saving the relationships and before saving context - that could lead to some data inconsistency (possibly during next sync library would try to resolve pending relationships between entries that were not saved and which does not exist). Not sure if this is a serious issue because sync request would probably continue from page that was interrupted by user\r\n\r\nRegarding invalid types: yes, I also thought that `DeletedRelationship` could be the reason of invalid type issues."}}
{"actor":{"display_login":"marcin-bo"}}