{"action":"created","issue":{"url":"https://api.github.com/repos/3lvis/DATAStack/issues/28","labels_url":"https://api.github.com/repos/3lvis/DATAStack/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/3lvis/DATAStack/issues/28/comments","events_url":"https://api.github.com/repos/3lvis/DATAStack/issues/28/events","html_url":"https://github.com/3lvis/DATAStack/issues/28","id":119206200,"number":28,"title":"Main thread context not working","user":{"login":"marcospolanco","id":179455,"avatar_url":"https://avatars.githubusercontent.com/u/179455?v=3","gravatar_id":"","url":"https://api.github.com/users/marcospolanco","html_url":"https://github.com/marcospolanco","followers_url":"https://api.github.com/users/marcospolanco/followers","following_url":"https://api.github.com/users/marcospolanco/following{/other_user}","gists_url":"https://api.github.com/users/marcospolanco/gists{/gist_id}","starred_url":"https://api.github.com/users/marcospolanco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcospolanco/subscriptions","organizations_url":"https://api.github.com/users/marcospolanco/orgs","repos_url":"https://api.github.com/users/marcospolanco/repos","events_url":"https://api.github.com/users/marcospolanco/events{/privacy}","received_events_url":"https://api.github.com/users/marcospolanco/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-11-27T14:40:24Z","updated_at":"2015-12-11T13:45:39Z","closed_at":"2015-11-28T06:13:53Z","body":"I am facing an issue where operations against the dataStack.mainContext are not effective; for example,\r\n\r\nprint(dataStack.mainContext.hasChanges) // true\r\ntry! dataStack.mainContext.save() \r\nprint(dataStack.mainContext.hasChanges) // false\r\n\r\nHowever, when the application reloads, the changes have not been committed to disk (reloading the database programmatically \"works\", but application restart does not.)\r\n\r\nSimply changing to performInNewBackgroundContext{} makes everything work.\r\n\r\nWhat might be the cause?"},"comment":{"url":"https://api.github.com/repos/3lvis/DATAStack/issues/comments/163939471","html_url":"https://github.com/3lvis/DATAStack/issues/28#issuecomment-163939471","issue_url":"https://api.github.com/repos/3lvis/DATAStack/issues/28","id":163939471,"user":{"login":"3lvis","id":1088217,"avatar_url":"https://avatars.githubusercontent.com/u/1088217?v=3","gravatar_id":"","url":"https://api.github.com/users/3lvis","html_url":"https://github.com/3lvis","followers_url":"https://api.github.com/users/3lvis/followers","following_url":"https://api.github.com/users/3lvis/following{/other_user}","gists_url":"https://api.github.com/users/3lvis/gists{/gist_id}","starred_url":"https://api.github.com/users/3lvis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/3lvis/subscriptions","organizations_url":"https://api.github.com/users/3lvis/orgs","repos_url":"https://api.github.com/users/3lvis/repos","events_url":"https://api.github.com/users/3lvis/events{/privacy}","received_events_url":"https://api.github.com/users/3lvis/received_events","type":"User","site_admin":false},"created_at":"2015-12-11T13:45:39Z","updated_at":"2015-12-11T13:45:39Z","body":"@markkrenek I see, what about?\r\n\r\n>Any reason why you have to do this on the main thread context instead of using a background one? In general, is not recommended to do any data mutation on the main thread.\r\n\r\n:grinning: "}}