{"action":"created","issue":{"url":"https://api.github.com/repos/magicalpanda/MagicalRecord/issues/1237","repository_url":"https://api.github.com/repos/magicalpanda/MagicalRecord","labels_url":"https://api.github.com/repos/magicalpanda/MagicalRecord/issues/1237/labels{/name}","comments_url":"https://api.github.com/repos/magicalpanda/MagicalRecord/issues/1237/comments","events_url":"https://api.github.com/repos/magicalpanda/MagicalRecord/issues/1237/events","html_url":"https://github.com/magicalpanda/MagicalRecord/issues/1237","id":157378599,"number":1237,"title":"Concurrent creating with saveWthBlock:completion: returns contextDidSave == NO && error == nil but all is saved.","user":{"login":"psi-gh","id":1121645,"avatar_url":"https://avatars.githubusercontent.com/u/1121645?v=3","gravatar_id":"","url":"https://api.github.com/users/psi-gh","html_url":"https://github.com/psi-gh","followers_url":"https://api.github.com/users/psi-gh/followers","following_url":"https://api.github.com/users/psi-gh/following{/other_user}","gists_url":"https://api.github.com/users/psi-gh/gists{/gist_id}","starred_url":"https://api.github.com/users/psi-gh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psi-gh/subscriptions","organizations_url":"https://api.github.com/users/psi-gh/orgs","repos_url":"https://api.github.com/users/psi-gh/repos","events_url":"https://api.github.com/users/psi-gh/events{/privacy}","received_events_url":"https://api.github.com/users/psi-gh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-29T09:56:50Z","updated_at":"2016-05-30T15:42:48Z","closed_at":null,"body":"For testing purpose i have the following code which called from main thread (in viewDidLoad method).\r\n\r\n```\r\nfor (int i = 0; i < 50; i++) {\r\n    [MagicalRecord saveWithBlock:^(NSManagedObjectContext * _Nonnull localContext) {\r\n        [FieldDescription MR_createEntityInContext:localContext];\r\n        // there is nothing to config, no primary attribute or smth, \r\n        // just need to create new entity and save it\r\n    } completion:^(BOOL contextDidSave, NSError * _Nullable error) {\r\n        if (!contextDidSave) {\r\n            DDLogError(@\"Error saving field description: %@\", error.localizedDescription);\r\n        }\r\n    }];\r\n}\r\n```\r\n\r\nIn a result, a part of entities saving is completed with `contextDidSave == YES`, but other part completed with `contextDidSave == NO && error == nil`. I get following messages in logs with it: \r\n`NO CHANGES IN ** MagicalRecord Root Saving Context ** CONTEXT - NOT SAVING`\r\nSeems like some of entities was not saved. But despite of that all entities eventually saved in storage. I can't rely on such odd result of saving operation to make my system reliable.\r\nWhat i'm missing and how can i make this works without such behaviour?\r\n\r\np.s. I know that if i place all of 50 those calls inside saveWithBlock it will work, but my current architecture won't allow me that because i'm making a lot of MagicalRecord calls from asynchronously operations."},"comment":{"url":"https://api.github.com/repos/magicalpanda/MagicalRecord/issues/comments/222517504","html_url":"https://github.com/magicalpanda/MagicalRecord/issues/1237#issuecomment-222517504","issue_url":"https://api.github.com/repos/magicalpanda/MagicalRecord/issues/1237","id":222517504,"user":{"login":"psi-gh","id":1121645,"avatar_url":"https://avatars.githubusercontent.com/u/1121645?v=3","gravatar_id":"","url":"https://api.github.com/users/psi-gh","html_url":"https://github.com/psi-gh","followers_url":"https://api.github.com/users/psi-gh/followers","following_url":"https://api.github.com/users/psi-gh/following{/other_user}","gists_url":"https://api.github.com/users/psi-gh/gists{/gist_id}","starred_url":"https://api.github.com/users/psi-gh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psi-gh/subscriptions","organizations_url":"https://api.github.com/users/psi-gh/orgs","repos_url":"https://api.github.com/users/psi-gh/repos","events_url":"https://api.github.com/users/psi-gh/events{/privacy}","received_events_url":"https://api.github.com/users/psi-gh/received_events","type":"User","site_admin":false},"created_at":"2016-05-30T15:42:48Z","updated_at":"2016-05-30T15:42:48Z","body":"Can anyone tell if this a bug or my misunderstanding? "}}
{"actor":{"display_login":"psi-gh"}}