{"action":"opened","issue":{"url":"https://api.github.com/repos/mozilla-mobile/prox/issues/228","repository_url":"https://api.github.com/repos/mozilla-mobile/prox","labels_url":"https://api.github.com/repos/mozilla-mobile/prox/issues/228/labels{/name}","comments_url":"https://api.github.com/repos/mozilla-mobile/prox/issues/228/comments","events_url":"https://api.github.com/repos/mozilla-mobile/prox/issues/228/events","html_url":"https://github.com/mozilla-mobile/prox/issues/228","id":190740497,"number":228,"title":"Harden Remote Config access to reduce catastrophic failure","user":{"login":"jhugman","id":99338,"avatar_url":"https://avatars.githubusercontent.com/u/99338?v=3","gravatar_id":"","url":"https://api.github.com/users/jhugman","html_url":"https://github.com/jhugman","followers_url":"https://api.github.com/users/jhugman/followers","following_url":"https://api.github.com/users/jhugman/following{/other_user}","gists_url":"https://api.github.com/users/jhugman/gists{/gist_id}","starred_url":"https://api.github.com/users/jhugman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhugman/subscriptions","organizations_url":"https://api.github.com/users/jhugman/orgs","repos_url":"https://api.github.com/users/jhugman/repos","events_url":"https://api.github.com/users/jhugman/events{/privacy}","received_events_url":"https://api.github.com/users/jhugman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-21T14:59:24Z","updated_at":"2016-11-21T14:59:24Z","closed_at":null,"body":"Right now, if an admin fat fingers or adds a value that cannot be parsed by Swift, then there is a explicit dereference of values which will cause a crash. \r\n\r\ne.g. https://github.com/mozilla-mobile/prox/blob/master/Prox/Prox/Data/PlacesController.swift#L40\r\n\r\n```swift\r\nreturn FIRRemoteConfig.remoteConfig()[key].numberValue!.doubleValue\r\n```\r\n\r\nWorse, the crash may occur before a corrected (non-crashing) config can be downloaded and applied, so the app will be unlaunchable.\r\n\r\nEach use of remote config must be guarded properly. \r\n\r\nProposal is to wrap all access of RemoteConfig, and the defaults into a property class, in `RemoteConfigKeys`\r\n\r\n```swift\r\nlet radius: RemoteConfigProperty<Double> = RemoteConfiDouble(\"radius\", 40) \r\n```\r\n\r\nAnd used: \r\n```swift\r\nlet radius = RemoteConfigKeys.radius.value\r\n```"}}
{"actor":{"display_login":"jhugman"}}