Skip to content

Conversation

@ericclemmons
Copy link
Contributor

Issue #, if available: Fixes #6873

#6146 & #6726 blocked PubSub.subscribe from being used in Node environments for security reasons (multi-tenant requests sharing the same socket), but isNode isn't a reliable indicator of that usage: ssr: true is.

isNode is a valid runtime for single-tenant environments, such as Electron.

This PR improves the specificity of the PubSub.subscribe check to match the use-case it was designed for (SSR) vs. blocking legitimate usages of sockets.


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

@@ -1,24 +0,0 @@
jest.mock('@aws-amplify/core', () => ({
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was actually renamed to .ssr.ts, but showing as a deletion 🤷

@lgtm-com
Copy link

lgtm-com bot commented Oct 8, 2020

This pull request introduces 1 alert when merging 1d84b07 into 53be43d - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

Copy link
Contributor

@manueliglesias manueliglesias left a comment

Choose a reason for hiding this comment

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

LGTM Thanks @ericclemmons !

Copy link
Contributor

@sammartinez sammartinez left a comment

Choose a reason for hiding this comment

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

LGTM 🌮

@ericclemmons ericclemmons merged commit e1d122b into aws-amplify:main Oct 8, 2020
@ericclemmons ericclemmons deleted the 6873-block-subscriptions-on-ssr branch October 8, 2020 22:19
ericclemmons added a commit to ericclemmons/amplify-js that referenced this pull request Nov 19, 2020
Partial revert of aws-amplify#6937
to ensure that subscriptions still work on the client.
@github-actions
Copy link

github-actions bot commented Oct 9, 2021

This pull request has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels or Discussions for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PubSub: Unblock subscriptions in desktop Node environments

3 participants