{"action":"opened","issue":{"url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-iOS-OSX/issues/159","labels_url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-iOS-OSX/issues/159/labels{/name}","comments_url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-iOS-OSX/issues/159/comments","events_url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-iOS-OSX/issues/159/events","html_url":"https://github.com/ParsePlatform/Parse-SDK-iOS-OSX/issues/159","id":104498611,"number":159,"title":"Exception when [Parse setApplicationId:clientKey:] is called twice","user":{"login":"wzs","id":599145,"avatar_url":"https://avatars.githubusercontent.com/u/599145?v=3","gravatar_id":"","url":"https://api.github.com/users/wzs","html_url":"https://github.com/wzs","followers_url":"https://api.github.com/users/wzs/followers","following_url":"https://api.github.com/users/wzs/following{/other_user}","gists_url":"https://api.github.com/users/wzs/gists{/gist_id}","starred_url":"https://api.github.com/users/wzs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wzs/subscriptions","organizations_url":"https://api.github.com/users/wzs/orgs","repos_url":"https://api.github.com/users/wzs/repos","events_url":"https://api.github.com/users/wzs/events{/privacy}","received_events_url":"https://api.github.com/users/wzs/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-02T14:52:42Z","updated_at":"2015-09-02T14:52:42Z","closed_at":null,"body":"Recently I've found in our codebase that `+[Parse setApplicationId:clientKey:]` was called twice during app initialization (with same params). \r\n\r\nIt was obviously mistake, but by the way I've found that in that case SDK throws exceptions, ie:\r\nduring call to `-[PFCommandURLRequestConstructor _URLRequestHeadersForCommand]`, `dataSource` became `nil` (it's a weak reference to `ParseManager`).\r\n\r\nIt'd be nice to have an assertion preventing from changing applicationId/clientKey after it's set already or cancel all ongoing operations started from the old instance of ParseManager."}}