{"action":"created","issue":{"url":"https://api.github.com/repos/realm/realm-cocoa/issues/3513","repository_url":"https://api.github.com/repos/realm/realm-cocoa","labels_url":"https://api.github.com/repos/realm/realm-cocoa/issues/3513/labels{/name}","comments_url":"https://api.github.com/repos/realm/realm-cocoa/issues/3513/comments","events_url":"https://api.github.com/repos/realm/realm-cocoa/issues/3513/events","html_url":"https://github.com/realm/realm-cocoa/issues/3513","id":152606683,"number":3513,"title":"WriteCopytoURL usage is leading to more crashes on next launch","user":{"login":"slreddy1137","id":17206527,"avatar_url":"https://avatars.githubusercontent.com/u/17206527?v=3","gravatar_id":"","url":"https://api.github.com/users/slreddy1137","html_url":"https://github.com/slreddy1137","followers_url":"https://api.github.com/users/slreddy1137/followers","following_url":"https://api.github.com/users/slreddy1137/following{/other_user}","gists_url":"https://api.github.com/users/slreddy1137/gists{/gist_id}","starred_url":"https://api.github.com/users/slreddy1137/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slreddy1137/subscriptions","organizations_url":"https://api.github.com/users/slreddy1137/orgs","repos_url":"https://api.github.com/users/slreddy1137/repos","events_url":"https://api.github.com/users/slreddy1137/events{/privacy}","received_events_url":"https://api.github.com/users/slreddy1137/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/realm/realm-cocoa/labels/S:Waiting%20For%20User","name":"S:Waiting For User","color":"ededed"},{"url":"https://api.github.com/repos/realm/realm-cocoa/labels/T:Help","name":"T:Help","color":"cc317c"}],"state":"open","locked":false,"assignee":{"login":"jpsim","id":474794,"avatar_url":"https://avatars.githubusercontent.com/u/474794?v=3","gravatar_id":"","url":"https://api.github.com/users/jpsim","html_url":"https://github.com/jpsim","followers_url":"https://api.github.com/users/jpsim/followers","following_url":"https://api.github.com/users/jpsim/following{/other_user}","gists_url":"https://api.github.com/users/jpsim/gists{/gist_id}","starred_url":"https://api.github.com/users/jpsim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpsim/subscriptions","organizations_url":"https://api.github.com/users/jpsim/orgs","repos_url":"https://api.github.com/users/jpsim/repos","events_url":"https://api.github.com/users/jpsim/events{/privacy}","received_events_url":"https://api.github.com/users/jpsim/received_events","type":"User","site_admin":false},"milestone":null,"comments":10,"created_at":"2016-05-02T17:57:57Z","updated_at":"2016-05-20T23:59:27Z","closed_at":null,"body":"Hi,\r\n\r\nI have been trying to use the writeCopyToURL when the app is going to background, this is reducing the Realm file size, but when i re-launch the app there are places where i m creating a Realm instance inside a dispatch queue those are not getting created and ignoring the complete code, and its crashing due to some old references, i have been trying to figure out to fix this but unable to.\r\n\r\nmy app has become more unstable and don't know when it crashes, it might to trying to refer to some of the old realm references.\r\n\r\ncode:\r\n\r\n    if (![RLMRealm defaultRealm].inWriteTransaction) {\r\n//        [[RLMRealm defaultRealm] invalidate];\r\n        \r\n        __block BOOL copySuccess = NO;\r\n        NSURL *realmURL = [[RLMRealmConfiguration defaultConfiguration] fileURL];\r\n        NSString *copyPath = [realmURL.path stringByAppendingString:@\".copy\"];\r\n        @autoreleasepool\r\n        {\r\n            [[NSFileManager defaultManager] removeItemAtPath:copyPath error:nil];\r\n            copySuccess = [[RLMRealm defaultRealm] writeCopyToURL:[NSURL URLWithString:copyPath] encryptionKey:nil error:nil];\r\n        }\r\n        \r\n        if (copySuccess && [[NSFileManager defaultManager] removeItemAtPath:realmURL.path error:nil])\r\n        {\r\n            NSError *err;\r\n            [[NSFileManager defaultManager] copyItemAtPath:copyPath toPath:realmURL.path error:&err];\r\n        }\r\n        \r\n    }\r\n\r\ncan someone guide me with best practise please.\r\n\r\nRealm version: 100.0\r\n\r\nXcode version: 7.2\r\n\r\niOS/OSX version: 9.0.2\r\n"},"comment":{"url":"https://api.github.com/repos/realm/realm-cocoa/issues/comments/220744683","html_url":"https://github.com/realm/realm-cocoa/issues/3513#issuecomment-220744683","issue_url":"https://api.github.com/repos/realm/realm-cocoa/issues/3513","id":220744683,"user":{"login":"slreddy1137","id":17206527,"avatar_url":"https://avatars.githubusercontent.com/u/17206527?v=3","gravatar_id":"","url":"https://api.github.com/users/slreddy1137","html_url":"https://github.com/slreddy1137","followers_url":"https://api.github.com/users/slreddy1137/followers","following_url":"https://api.github.com/users/slreddy1137/following{/other_user}","gists_url":"https://api.github.com/users/slreddy1137/gists{/gist_id}","starred_url":"https://api.github.com/users/slreddy1137/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slreddy1137/subscriptions","organizations_url":"https://api.github.com/users/slreddy1137/orgs","repos_url":"https://api.github.com/users/slreddy1137/repos","events_url":"https://api.github.com/users/slreddy1137/events{/privacy}","received_events_url":"https://api.github.com/users/slreddy1137/received_events","type":"User","site_admin":false},"created_at":"2016-05-20T23:59:27Z","updated_at":"2016-05-20T23:59:27Z","body":"Hi,\n\nEven after trying this approach I m seeing more unknown crashes, figuring out ways to get it fixed.\n\n\nSent from my iPhone\n\n> On 20-May-2016, at 7:33 PM, JP Simard <notifications@github.com> wrote:\n> \n> @slreddy1137 did you get this to work? any reason to keep this ticket open?\n> \n> —\n> You are receiving this because you were mentioned.\n> Reply to this email directly or view it on GitHub\n> \n"}}
{"actor":{"display_login":"slreddy1137"}}