-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pages: check for recent errors, add placeholder for errored requests. #1247
Conversation
I have a question about this approach: we have notices (dev-only at the moment) that display an offline message. We chose not to put those in production (I'm not remembering the details), but I think it's a good idea to talk through a unified approach to all sections while we're addressing this issue. The disconnected notice flashes as you lose and regain connection, whereas this issue occurs when attempting to switch sections. I think the proposed solution is better than seeing a placeholder flash forever and certainly better than seeing a false 'you don't have any pages' message, I just want to make sure this is something we could do for every section. |
Certainly! Which is why I asked for a design review. :) I would probably suggest opening up new issues/PRs for the other affected areas so this PR won't grow too large. At the very least I'll create a few new issues around making sure the experience between Posts/Pages are similar. |
I think the design works! Much better than the placeholder and much better than an inaccurate and scary empty content message. |
86736bd
to
dc1685b
Compare
Excellent... we limit the requests to a reasonable throttle. It comes back if you fix your connection. Maybe in future we could get fancier with our connection detection, and queue up failed attempts (across different endpoints) that we know we want to re-try once we detect the connection has been re-established, versus waiting for the 30-second throttle to iterate. But I think this is the right approach to fix this issue now. |
👍 Adding in a circuit breaker pattern could be a great enhancement in the future, maybe using: https://github.com/yammer/circuit-breaker-js |
…nected-358 Pages: check for recent errors, add placeholder for errored requests.
Fixes #358, where after losing internet connection, the pages placeholder would glitch between a loading placeholder and an empty placeholder. This PR adds a method hasRecentError to the store, so the we can limit the number of actions dispatched from the view when the store enters that state. This also adds a simple errored placeholder to pages.
Testing instructions:
Before:
![glitch](https://cloud.githubusercontent.com/assets/1270189/11575424/c811c7f4-99c5-11e5-80e8-a7b4db202273.gif)
![after](https://cloud.githubusercontent.com/assets/1270189/11575427/ccad7394-99c5-11e5-886b-0a8c631d3423.png)
After:
cc @rralian @rickybanister