{"action":"opened","issue":{"url":"https://api.github.com/repos/CodementorIO/rest-firebase/issues/9","repository_url":"https://api.github.com/repos/CodementorIO/rest-firebase","labels_url":"https://api.github.com/repos/CodementorIO/rest-firebase/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/CodementorIO/rest-firebase/issues/9/comments","events_url":"https://api.github.com/repos/CodementorIO/rest-firebase/issues/9/events","html_url":"https://github.com/CodementorIO/rest-firebase/issues/9","id":130804470,"number":9,"title":"Reconnecting (missing auth)","user":{"login":"volksport","id":55130,"avatar_url":"https://avatars.githubusercontent.com/u/55130?v=3","gravatar_id":"","url":"https://api.github.com/users/volksport","html_url":"https://github.com/volksport","followers_url":"https://api.github.com/users/volksport/followers","following_url":"https://api.github.com/users/volksport/following{/other_user}","gists_url":"https://api.github.com/users/volksport/gists{/gist_id}","starred_url":"https://api.github.com/users/volksport/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/volksport/subscriptions","organizations_url":"https://api.github.com/users/volksport/orgs","repos_url":"https://api.github.com/users/volksport/repos","events_url":"https://api.github.com/users/volksport/events{/privacy}","received_events_url":"https://api.github.com/users/volksport/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-02T20:17:36Z","updated_at":"2016-02-02T20:17:36Z","closed_at":null,"body":"So I added RestFirebase::Error::ClientError to my :retry_exceptions and I'm sometimes seeing this during reconnects (first one is from onerror, second is from rest-firebase):\r\n```\r\nMy Errors: Please set your secret RestFirebase::Error::ClientError\r\nRestCore: ERROR: Please set your secret\r\n```\r\n\r\nIt appears to be hitting onerror properly, shouldn't that catch it, and not bubble up to a failure? But moreso, why is this happening? The auth is in fact being set during the initial connection (and properly connects), maybe it loses track of it for reconnecting?\r\n\r\n```\r\nfrom [\r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-firebase-e825acb062da/lib/rest-firebase.rb:89:in `generate_auth'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-firebase-e825acb062da/lib/rest-firebase.rb:107:in `default_auth'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/client.rb:376:in `auth'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-firebase-e825acb062da/lib/rest-firebase.rb:102:in `query'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/client.rb:56:in `block in attributes'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/client.rb:56:in `each_pair'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/client.rb:56:in `each'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/client.rb:56:in `map'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/client.rb:56:in `attributes'\",\r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/client.rb:194:in `build_env'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/client.rb:166:in `request_full'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/client.rb:159:in `request'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-firebase-e825acb062da/lib/rest-firebase.rb:85:in `request'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/client.rb:100:in `get'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/event_source.rb:129:in `reconnect'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/event_source.rb:89:in `onreconnect'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/event_source.rb:71:in `onerror'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/event_source.rb:52:in `rescue in onopen'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/event_source.rb:38:in `onopen'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/event_source.rb:133:in `block in reconnect'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/client.rb:159:in `block in request'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/client.rb:167:in `call'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/client.rb:167:in `block in request_full'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/middleware/retry.rb:20:in `call'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/middleware/retry.rb:20:in `process'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/middleware/retry.rb:14:in `block in call'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/middleware/follow_redirect.rb:18:in `call'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/middleware/follow_redirect.rb:18:in `process'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/middleware/follow_redirect.rb:12:in `block in call'\",\r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/middleware/error_handler.rb:16:in `block in call'\",\r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/middleware/error_detector.rb:11:in `block in call'\",\r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/middleware/json_response.rb:26:in `block in call'\",\r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/middleware/common_logger.rb:13:in `block in call'\",\r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/middleware/cache.rb:35:in `block in app_call'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/promise.rb:199:in `call'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/promise.rb:199:in `block in callback'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/promise.rb:193:in `each'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/promise.rb:193:in `inject'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/promise.rb:193:in `callback'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/promise.rb:145:in `fulfilling'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/promise.rb:106:in `block in fulfill'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/promise.rb:106:in `synchronize'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/promise.rb:106:in `fulfill'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/engine/http-client.rb:38:in `request_async'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/engine/http-client.rb:20:in `request'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/engine.rb:12:in `block in call'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/promise.rb:85:in `block (2 levels) in defer'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/promise.rb:163:in `block in protected_yield'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/promise.rb:185:in `timeout_protected_yield'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/promise.rb:163:in `protected_yield'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/promise.rb:85:in `block in defer'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/engine.rb:12:in `call'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/middleware/cache.rb:30:in `app_call'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/middleware/cache.rb:26:in `call'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/middleware/common_logger.rb:12:in `call'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/middleware/json_response.rb:24:in `call'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/middleware/error_detector.rb:9:in `call'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/middleware/error_handler.rb:9:in `call'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/middleware/follow_redirect.rb:12:in `call'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/middleware/follow_redirect.rb:29:in `process'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/middleware/follow_redirect.rb:12:in `block in call'\",\r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/middleware/error_handler.rb:16:in `block in call'\",\r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/middleware/error_detector.rb:11:in `block in call'\",\r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/middleware/json_response.rb:26:in `block in call'\",\r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/middleware/common_logger.rb:13:in `block in call'\",\r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/middleware/cache.rb:35:in `block in app_call'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/promise.rb:199:in `call'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/promise.rb:199:in `block in callback'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/promise.rb:193:in `each'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/promise.rb:193:in `inject'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/promise.rb:193:in `callback'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/promise.rb:145:in `fulfilling'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/promise.rb:106:in `block in fulfill'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/promise.rb:106:in `synchronize'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/promise.rb:106:in `fulfill'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/engine/http-client.rb:38:in `request_async'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/engine/http-client.rb:20:in `request'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/engine.rb:12:in `block in call'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/promise.rb:85:in `block (2 levels) in defer'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/promise.rb:163:in `block in protected_yield'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/promise.rb:185:in `timeout_protected_yield'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/promise.rb:163:in `protected_yield'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/promise.rb:85:in `block in defer'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/engine.rb:12:in `call'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/middleware/cache.rb:30:in `app_call'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/middleware/cache.rb:26:in `call'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/middleware/common_logger.rb:12:in `call'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/middleware/json_response.rb:24:in `call'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/middleware/error_detector.rb:9:in `call'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/middleware/error_handler.rb:9:in `call'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/middleware/follow_redirect.rb:12:in `call'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/middleware/timeout.rb:18:in `process'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/middleware/timeout.rb:13:in `call'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/middleware/retry.rb:14:in `call'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/middleware/json_request.rb:13:in `call'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/middleware/default_query.rb:9:in `call'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/middleware/default_headers.rb:9:in `call'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/middleware/default_site.rb:15:in `call'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/client.rb:166:in `request_full'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/client.rb:159:in `request'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-firebase-e825acb062da/lib/rest-firebase.rb:85:in `request'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/client.rb:100:in `get'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/event_source.rb:129:in `reconnect'\", \r\n\"/app/vendor/bundle/ruby/2.1.0/bundler/gems/rest-core-c169272abccf/lib/rest-core/event_source.rb:18:in `start'\", \r\n\"/app/lib/daemons/disconnected.rb:86:in `<top (required)>'\",\r\n\"/app/vendor/bundle/ruby/2.1.0/gems/daemons-1.2.2/lib/daemons/application.rb:218:in `load'\",\r\n\"/app/vendor/bundle/ruby/2.1.0/gems/daemons-1.2.2/lib/daemons/application.rb:218:in `start_load'\",\r\n\"/app/vendor/bundle/ruby/2.1.0/gems/daemons-1.2.2/lib/daemons/application.rb:297:in `start'\",\r\n\"/app/vendor/bundle/ruby/2.1.0/gems/daemons-1.2.2/lib/daemons/controller.rb:59:in `run'\",\r\n\"/app/vendor/bundle/ruby/2.1.0/gems/daemons-1.2.2/lib/daemons.rb:144:in `block in run'\",\r\n\"/app/vendor/bundle/ruby/2.1.0/gems/daemons-1.2.2/lib/daemons/cmdline.rb:88:in `call'\",\r\n\"/app/vendor/bundle/ruby/2.1.0/gems/daemons-1.2.2/lib/daemons/cmdline.rb:88:in `catch_exceptions'\",\r\n\"/app/vendor/bundle/ruby/2.1.0/gems/daemons-1.2.2/lib/daemons.rb:143:in `run'\",\r\n\"/app/lib/daemons/disconnected_control.rb:3:in `<main>'\"\r\n```"}}