{"action":"created","issue":{"url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/issues/1075","labels_url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/issues/1075/labels{/name}","comments_url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/issues/1075/comments","events_url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/issues/1075/events","html_url":"https://github.com/couchbase/couchbase-lite-ios/issues/1075","id":129480790,"number":1075,"title":"Inconsistent managed objects contexts with CBLIS","user":{"login":"mastohhh","id":1760064,"avatar_url":"https://avatars.githubusercontent.com/u/1760064?v=3","gravatar_id":"","url":"https://api.github.com/users/mastohhh","html_url":"https://github.com/mastohhh","followers_url":"https://api.github.com/users/mastohhh/followers","following_url":"https://api.github.com/users/mastohhh/following{/other_user}","gists_url":"https://api.github.com/users/mastohhh/gists{/gist_id}","starred_url":"https://api.github.com/users/mastohhh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mastohhh/subscriptions","organizations_url":"https://api.github.com/users/mastohhh/orgs","repos_url":"https://api.github.com/users/mastohhh/repos","events_url":"https://api.github.com/users/mastohhh/events{/privacy}","received_events_url":"https://api.github.com/users/mastohhh/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/labels/backlog","name":"backlog","color":"ededed"},{"url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/labels/docs","name":"docs","color":"fad8c7"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/milestones/15","html_url":"https://github.com/couchbase/couchbase-lite-ios/milestones/1.3","labels_url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/milestones/15/labels","id":1348000,"number":15,"title":"1.3","description":"","creator":{"login":"zgramana","id":759830,"avatar_url":"https://avatars.githubusercontent.com/u/759830?v=3","gravatar_id":"","url":"https://api.github.com/users/zgramana","html_url":"https://github.com/zgramana","followers_url":"https://api.github.com/users/zgramana/followers","following_url":"https://api.github.com/users/zgramana/following{/other_user}","gists_url":"https://api.github.com/users/zgramana/gists{/gist_id}","starred_url":"https://api.github.com/users/zgramana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zgramana/subscriptions","organizations_url":"https://api.github.com/users/zgramana/orgs","repos_url":"https://api.github.com/users/zgramana/repos","events_url":"https://api.github.com/users/zgramana/events{/privacy}","received_events_url":"https://api.github.com/users/zgramana/received_events","type":"User","site_admin":false},"open_issues":17,"closed_issues":1,"state":"open","created_at":"2015-10-09T22:24:58Z","updated_at":"2016-01-29T00:51:21Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2016-01-28T15:16:37Z","updated_at":"2016-01-29T10:07:26Z","closed_at":null,"body":"When we reproduce #1061 we are in a state where on a device we have a `team.players` with 3 players and the other side `team.players` with 10 players.\r\n\r\nWe just pushed a new commit on #1060 that creates a player when we select a team's cell.\r\n\r\nSo when you create a player in the team where there is less players, the other device now duplicates the team. One team with a `permanentID` and the other always stays with a `temporaryID`, even if we `save` contexts.\r\n\r\nThis is a NSManagedObjectContext problem because when we relaunch apps, everything come back to normal.\r\n\r\nIf contexts are not representative of the `CBLDocument`s (in this example both sides are wrong), could this corrupt data ? Until the app restarts (or crash) contexts never gets back to normal, what about documents ?"},"comment":{"url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/issues/comments/176677924","html_url":"https://github.com/couchbase/couchbase-lite-ios/issues/1075#issuecomment-176677924","issue_url":"https://api.github.com/repos/couchbase/couchbase-lite-ios/issues/1075","id":176677924,"user":{"login":"mastohhh","id":1760064,"avatar_url":"https://avatars.githubusercontent.com/u/1760064?v=3","gravatar_id":"","url":"https://api.github.com/users/mastohhh","html_url":"https://github.com/mastohhh","followers_url":"https://api.github.com/users/mastohhh/followers","following_url":"https://api.github.com/users/mastohhh/following{/other_user}","gists_url":"https://api.github.com/users/mastohhh/gists{/gist_id}","starred_url":"https://api.github.com/users/mastohhh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mastohhh/subscriptions","organizations_url":"https://api.github.com/users/mastohhh/orgs","repos_url":"https://api.github.com/users/mastohhh/repos","events_url":"https://api.github.com/users/mastohhh/events{/privacy}","received_events_url":"https://api.github.com/users/mastohhh/received_events","type":"User","site_admin":false},"created_at":"2016-01-29T10:07:26Z","updated_at":"2016-01-29T10:07:26Z","body":"@pasin about permanentID and temporaryID, it's just the state of the objects after reproducing this bug. We didn't do anything about that. We just create objects with classic methods.\r\n\r\nThis issue tries to show that, when we get a inconsistent context (like reproducing #1061), the fact of using if (insert update delete) causes problems on every other devices that are currently in sync. And every contexts of every devices gets inconsistent too."}}