{"action":"created","issue":{"url":"https://api.github.com/repos/contiamo/restful-react/issues/91","repository_url":"https://api.github.com/repos/contiamo/restful-react","labels_url":"https://api.github.com/repos/contiamo/restful-react/issues/91/labels{/name}","comments_url":"https://api.github.com/repos/contiamo/restful-react/issues/91/comments","events_url":"https://api.github.com/repos/contiamo/restful-react/issues/91/events","html_url":"https://github.com/contiamo/restful-react/issues/91","id":377800932,"node_id":"MDU6SXNzdWUzNzc4MDA5MzI=","number":91,"title":"Implement an backoff strategy on Poll","user":{"login":"TejasQ","id":9947422,"node_id":"MDQ6VXNlcjk5NDc0MjI=","avatar_url":"https://avatars1.githubusercontent.com/u/9947422?v=4","gravatar_id":"","url":"https://api.github.com/users/TejasQ","html_url":"https://github.com/TejasQ","followers_url":"https://api.github.com/users/TejasQ/followers","following_url":"https://api.github.com/users/TejasQ/following{/other_user}","gists_url":"https://api.github.com/users/TejasQ/gists{/gist_id}","starred_url":"https://api.github.com/users/TejasQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TejasQ/subscriptions","organizations_url":"https://api.github.com/users/TejasQ/orgs","repos_url":"https://api.github.com/users/TejasQ/repos","events_url":"https://api.github.com/users/TejasQ/events{/privacy}","received_events_url":"https://api.github.com/users/TejasQ/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-06T11:16:59Z","updated_at":"2018-11-06T13:28:48Z","closed_at":null,"author_association":"MEMBER","body":"**Is your feature request related to a problem? Please describe.**\r\nThis is related to #82. That issue is a little more nuanced as some error codes are retry-able, and others arent: for example, we can safely stop on a `404` and a `401`, but maybe not so much on a `503`.\r\n\r\nCurrently, if we're polling an endpoint that is returning retry-able error codes, it would be nice to have some type of backoff strategy.\r\n\r\n**Describe the solution you'd like**\r\n\r\n- Endpoint returns `503` (Temporarily Unavailalble)\r\n  - We wait a little bit longer, try again\r\n    - Still `503`\r\n      - We wait _even longer_, try again\r\n        - ...\r\n          - `304`.\r\n            - Awesome. Keep going.\r\n              - `200` with `x-polling-index` header.\r\n                - Awesome. Keep going.\r\n                  - `200` without `x-polling-index` header\r\n                      - Awesome. Stop.\r\n\r\n\r\n**Describe alternatives you've considered**\r\n1. Fail and stop polling until full reload: this doesn't quite make sense on things that are _retry-able_ (a la network downtime) because if the network comes back, the user needs to be updated.\r\n\r\n1. Brute force poll: this will keep making requests against the server without letting it breathe and might be an exercise in futility since a server could be `503`ing for hours.\r\n\r\nThoughts?\r\n"},"comment":{"url":"https://api.github.com/repos/contiamo/restful-react/issues/comments/436252306","html_url":"https://github.com/contiamo/restful-react/issues/91#issuecomment-436252306","issue_url":"https://api.github.com/repos/contiamo/restful-react/issues/91","id":436252306,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNjI1MjMwNg==","user":{"login":"fabien0102","id":1761469,"node_id":"MDQ6VXNlcjE3NjE0Njk=","avatar_url":"https://avatars1.githubusercontent.com/u/1761469?v=4","gravatar_id":"","url":"https://api.github.com/users/fabien0102","html_url":"https://github.com/fabien0102","followers_url":"https://api.github.com/users/fabien0102/followers","following_url":"https://api.github.com/users/fabien0102/following{/other_user}","gists_url":"https://api.github.com/users/fabien0102/gists{/gist_id}","starred_url":"https://api.github.com/users/fabien0102/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabien0102/subscriptions","organizations_url":"https://api.github.com/users/fabien0102/orgs","repos_url":"https://api.github.com/users/fabien0102/repos","events_url":"https://api.github.com/users/fabien0102/events{/privacy}","received_events_url":"https://api.github.com/users/fabien0102/received_events","type":"User","site_admin":false},"created_at":"2018-11-06T13:28:48Z","updated_at":"2018-11-06T13:28:48Z","author_association":"CONTRIBUTOR","body":"Another idea, if it's only to deal with network downtime issue, we can implement this properly regarding the browser events (https://developer.mozilla.org/en-US/docs/Web/API/NavigatorOnLine/Online_and_offline_events)\r\n\r\nWe can also add `retry` callback with a boolean to know that we are in this non-polling state, so we can add a nice modal/message to permit a retry from the user directly"}}
{"actor":{"display_login":"fabien0102"}}