{"action":"created","issue":{"url":"https://api.github.com/repos/BranchMetrics/Branch-iOS-SDK/issues/80","labels_url":"https://api.github.com/repos/BranchMetrics/Branch-iOS-SDK/issues/80/labels{/name}","comments_url":"https://api.github.com/repos/BranchMetrics/Branch-iOS-SDK/issues/80/comments","events_url":"https://api.github.com/repos/BranchMetrics/Branch-iOS-SDK/issues/80/events","html_url":"https://github.com/BranchMetrics/Branch-iOS-SDK/pull/80","id":67668290,"number":80,"title":"Callback all the things v1","user":{"login":"shortstuffsushi","id":1016147,"avatar_url":"https://avatars.githubusercontent.com/u/1016147?v=3","gravatar_id":"","url":"https://api.github.com/users/shortstuffsushi","html_url":"https://github.com/shortstuffsushi","followers_url":"https://api.github.com/users/shortstuffsushi/followers","following_url":"https://api.github.com/users/shortstuffsushi/following{/other_user}","gists_url":"https://api.github.com/users/shortstuffsushi/gists{/gist_id}","starred_url":"https://api.github.com/users/shortstuffsushi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shortstuffsushi/subscriptions","organizations_url":"https://api.github.com/users/shortstuffsushi/orgs","repos_url":"https://api.github.com/users/shortstuffsushi/repos","events_url":"https://api.github.com/users/shortstuffsushi/events{/privacy}","received_events_url":"https://api.github.com/users/shortstuffsushi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-04-10T19:46:36Z","updated_at":"2015-04-16T18:08:55Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/BranchMetrics/Branch-iOS-SDK/pulls/80","html_url":"https://github.com/BranchMetrics/Branch-iOS-SDK/pull/80","diff_url":"https://github.com/BranchMetrics/Branch-iOS-SDK/pull/80.diff","patch_url":"https://github.com/BranchMetrics/Branch-iOS-SDK/pull/80.patch"},"body":"@aaustin @qinweigong @derrickstaten @Sarkar \r\n\r\nThis is largely a rewrite of most of the internals of Branch.m. It is step one of what I'm hoping to accomplish in separating a lot of the queuing logic from Branch itself.\r\n\r\nSome other things coming out of this:\r\n  * Errors are more specific to their failure, not just a generic message.\r\n  * Queue is not persisted on *every* request, but instead on a time basis.\r\n  * Fix infinite loop of logging/encoding in debug mode.\r\n  * Requests are actually asynchronous, no need to have `dispatch_async` everywhere anymore.\r\n  * Requests now have a specific callback rather than the big switch statement.\r\n  * When not initialized and a request is made, an initialization requests will be pushed into the queue.\r\n  * Initialization is managed by a single boolean instead of five.\r\n  * Logic around failure has changed some:\r\n    * All requests call back to their callbacks, every time.\r\n    * All requests are dequeued\r\n    * `setIdentity` and `userCompletedAction` requests are re-enqueued, minus their callback.\r\n\r\nThis will need manual review, you're not just going to be able to read the diff, since it's such a huge rework."},"comment":{"url":"https://api.github.com/repos/BranchMetrics/Branch-iOS-SDK/issues/comments/93804814","html_url":"https://github.com/BranchMetrics/Branch-iOS-SDK/pull/80#issuecomment-93804814","issue_url":"https://api.github.com/repos/BranchMetrics/Branch-iOS-SDK/issues/80","id":93804814,"user":{"login":"aaustin","id":1332632,"avatar_url":"https://avatars.githubusercontent.com/u/1332632?v=3","gravatar_id":"","url":"https://api.github.com/users/aaustin","html_url":"https://github.com/aaustin","followers_url":"https://api.github.com/users/aaustin/followers","following_url":"https://api.github.com/users/aaustin/following{/other_user}","gists_url":"https://api.github.com/users/aaustin/gists{/gist_id}","starred_url":"https://api.github.com/users/aaustin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaustin/subscriptions","organizations_url":"https://api.github.com/users/aaustin/orgs","repos_url":"https://api.github.com/users/aaustin/repos","events_url":"https://api.github.com/users/aaustin/events{/privacy}","received_events_url":"https://api.github.com/users/aaustin/received_events","type":"User","site_admin":false},"created_at":"2015-04-16T18:08:55Z","updated_at":"2015-04-16T18:08:55Z","body":"I hate to dump this on you but can you add tests for the 4 scenarios i mentioned in slack yesterday:\r\n1. Session init with internet, which is dropped thereafter for further requests. Then close with no internet, reopen with internet and should recover. Also make sure all callbacks are executed in every scenario with proper errors.\r\n2. Session init without internet, make further requests, close with no internet, reopen with internet and make sure recovers. Also make sure all callbacks are executed in every scenario with proper errors.\r\n3. Session init with internet, which is dropped thereafter for further requests, then reenable internet and let recover\r\n4.  Session init without internet, make further requests, reenable internet and make sure recovers.\r\n"}}