aws-amplify / amplify-js

A declarative JavaScript library for application development using cloud services.
https://docs.amplify.aws/lib/q/platform/js
Apache License 2.0
9.44k stars 2.13k forks source link

fix(api-graphql): close WS on events.closeAll #13989

Closed iartemiev closed 2 weeks ago

iartemiev commented 2 weeks ago

Description of changes

events.closeAll() is intended to close the WS connection, disconnect listeners and reconnect observers. However, the underlying AWSWebSocketProvider.close() method does all of the above, except for close the WS connection. To limit the blast radius of this change, this PR only modifies the AWSAppSyncEventProvider sub class, closing the WS connection on close() and leaves the AppSyncRealTimeProvider unchanged.

Issue #, if available

https://github.com/aws-amplify/amplify-js/issues/13984

Description of how you validated changes

Checklist