Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Merged
merged 1 commit into from
Nov 6, 2024
Merged

Conversation

iartemiev
Copy link
Member

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

#13984

Description of how you validated changes

  • Manual
  • Added fn test

Checklist

  • PR description included
  • yarn test passes
  • Unit Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)

@iartemiev iartemiev requested a review from a team as a code owner November 6, 2024 14:05
await fn();
await Promise.resolve();
Copy link
Member Author

Choose a reason for hiding this comment

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

This line is redundant and has no effect on any of the tests. Removing it for clarity.

Copy link
Member

@stocaaro stocaaro left a comment

Choose a reason for hiding this comment

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

LGTM

@iartemiev iartemiev merged commit 168ecff into main Nov 6, 2024
32 checks passed
@iartemiev iartemiev deleted the fix-events-close-all branch November 6, 2024 15:13
Copy link
Member

@svidgen svidgen left a comment

Choose a reason for hiding this comment

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

My brain's missing something. Can you add an explanation in a docstring as to why the awsRealTimeSocket only needs to be closed in the on provider? The PR description says it's to "limit blast radius" of the change. But, that makes it sound like we have more research to do.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants