-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add API Hub Connection state monitoring instructions #4505
Conversation
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.
one nit - otherwise looks good!
@@ -39,6 +38,27 @@ Amplify.configure({ | |||
}); | |||
``` | |||
|
|||
### Subscription connection status updates | |||
|
|||
While there are active subscription, the device is running your application and the network is healthy, your application will maintain a connection with AppSync. If you need to monitor the connection state, these states are made available via Hub. |
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.
The first sentence needs a bit of rewording I think. It took me a minute to grasp what it is trying to convey.
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.
Alright. I gave it a rewrite with the aim of making it more clear and actionable. I've also included a screen capture in the description so that you can see what it looks like with the fragment inlined.
Had a merge conflict with the prior change, that has been resolved. |
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.
Much better! LGTM!
- **Connected** - The service is connected and working with no issues. | ||
- **ConnectedPendingDisconnect** - The service connection has no active subscriptions and is disconnecting. | ||
- **ConnectedPendingKeepAlive** - The service connection is open, but has missed expected keep alive messages. | ||
- **ConnectedPendingNetwork** - The service connection is open, but the network connection has been disrupted. When the network recovers, the connection will continue serving traffic. | ||
- **Connecting** - The service is attempting to connect. | ||
- **ConnectionDisrupted** - The service connection is disrupted and the network is available. | ||
- **ConnectionDisruptedPendingNetwork** - The service connection is disrupted and the network connection is unavailable. | ||
- **Disconnected** - The service has no active subscriptions and has been disconnected. |
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.
I would do Connected
to highlight that is code
, same for the others
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.
Updated. Didn't make as clear a difference as I would have expected
- **Connected** - The service is connected and working with no issues. | ||
- **ConnectedPendingDisconnect** - The service connection has no active subscriptions and is disconnecting. | ||
- **ConnectedPendingKeepAlive** - The service connection is open, but has missed expected keep alive messages. | ||
- **ConnectedPendingNetwork** - The service connection is open, but the network connection has been disrupted. When the network recovers, the connection will continue serving traffic. | ||
- **Connecting** - The service is attempting to connect. | ||
- **ConnectionDisrupted** - The service connection is disrupted and the network is available. | ||
- **ConnectionDisruptedPendingNetwork** - The service connection is disrupted and the network connection is unavailable. | ||
- **Disconnected** - The service has no active subscriptions and has been disconnected. |
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.
I am not sure about the word service sounds to me like I am monitoring a service rather than client-server
connection? I think the word service could be remove in almost all the cases, what do you think?
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.
For example
The service connection has no active subscriptions and is disconnecting.
To:
Connection has no active subscriptions and is disconnecting.
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.
Good call. I have removed the word service from these descriptions.
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.
Looks great!
Thanks @stocaaro 🎉
Issue #, if available:
Description of changes:
Having added Hub messages corresponding the AppSync websocket connection changes in amplify-js PR #10063, this updates the API documentation with basic instructions on how to access these messages.
Reviewing this change, it appears that VSCode automatically made a number of whitespace and code changes corresponding with prettier configuration. Happy to revert these if that is preferred.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.