-
Notifications
You must be signed in to change notification settings - Fork 2
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
Poll for API connection and show notification when it fails #303
Conversation
Does this mean that SB will poll Chromatic every fifth second just by being open, regardless of if the addon is in active use or not? I don't think that's the right trade-off:
Can't we just poll for network connection when the addon is actually in use? Like when the user is downloading diffs or waiting for results to finish? |
@JReinhold I understand your concern and I think it makes sense to disable it when the addon hasn’t been interacted with for a while. But I’ll also address your specific concerns:
Do you think we should omit the notification? That wasn’t part of the original design, and isn’t really necessary. |
Ah okay, sorry for my ignorance, that makes more sense when it's server side. Then I'm fine with most of this actually, except I agree that the notification should be removed. I understand that "polling when addon is in use" is then more complex, given you'd need to send "is panel open" data over the channel which might not be worth it. |
…between retries, and abort after 10 attempts
…check to be retried through the UI
@JReinhold I've updated the PR:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ✨
Runs a (server-side) GraphQL query every 5 seconds to check whether it's connected. If not, it prevents starting a new build:
And shows a warning screen in the addon panel:
These automatically go away when the connection is restored (delayed up to 5 seconds as it polls).
When the automatic retry is aborted after 10 attempts (~50 seconds), the user is prompted to retry manually:
This way we don't just keep trying indefinitely when there is no internet connection.
📦 Published PR as canary version:
1.4.0--canary.303.3053a3b.0
✨ Test out this PR locally via:
npm install @chromatic-com/storybook@1.4.0--canary.303.3053a3b.0 # or yarn add @chromatic-com/storybook@1.4.0--canary.303.3053a3b.0