feat(data): add publish events over WebSocket#14242
Conversation
| @@ -70,7 +70,7 @@ async function connect( | |||
| }; | |||
|
|
|||
| // WS publish is not enabled in the service yet. It will be a follow up feature | |||
There was a problem hiding this comment.
Yes, this comment has been removed.
stocaaro
left a comment
There was a problem hiding this comment.
We discussed offline how I would expect event.connect should allow both publish and subscribe until the channel has been closed, after which neither publish nor subscribe should work. With multi-channel, there are oddities around how this works in this implementation.
This change adds publish events to websockets. There should be tests added for this on the provider tests.
| return super.publish(options, customUserAgentDetails); | ||
| } | ||
|
|
||
| public closeIfNoActiveChannel() { |
There was a problem hiding this comment.
This class/abstraction doesn't know about channels and the channel check is on the outer call. Can we rename this, maybe "closeIfNoActiveSubscription"?
There was a problem hiding this comment.
Looking around, I suppose we do have channel params in the query params. I still think this is checking subs, not channels.
Description of changes
Add support to publish events over WebSocket connection for Amplify events client. Customers can now perform the following operations to publish their events.
Description of how you validated changes
Checklist
yarn testpassesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.