Skip to content
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

Merged
merged 7 commits into from
Aug 4, 2022

Conversation

stocaaro
Copy link
Member

@stocaaro stocaaro commented Aug 3, 2022

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.

Screen Shot 2022-08-04 at 6 31 11 PM

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@stocaaro stocaaro requested a review from a team as a code owner August 3, 2022 22:18
@stocaaro stocaaro requested a review from a team August 3, 2022 22:18
Copy link
Contributor

@abdallahshaban557 abdallahshaban557 left a 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.
Copy link
Contributor

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.

Copy link
Member Author

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.

@stocaaro
Copy link
Member Author

stocaaro commented Aug 4, 2022

Had a merge conflict with the prior change, that has been resolved.

Copy link
Contributor

@abdallahshaban557 abdallahshaban557 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much better! LGTM!

Comment on lines 3 to 10
- **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.
Copy link
Contributor

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

Copy link
Member Author

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

Comment on lines 3 to 10
- **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.
Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Member Author

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.

Copy link
Contributor

@elorzafe elorzafe left a 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 🎉

@stocaaro stocaaro merged commit 059ff27 into aws-amplify:main Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants