-
Notifications
You must be signed in to change notification settings - Fork 56
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
[ECO-4780] Fix Connection closed
error when using usePresence
hook
#1761
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VeskeR
changed the title
Fix
[ECO-4780] Fix May 14, 2024
Connection closed
error when using usePresence
hookConnection closed
error when using usePresence
hook
github-actions
bot
temporarily deployed
to
staging/pull/1761/bundle-report
May 14, 2024 06:10
Inactive
ttypic
approved these changes
May 15, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch!
ttypic
reviewed
May 15, 2024
VeskeR
force-pushed
the
1753/fix-usePresence-connection-closed
branch
from
May 22, 2024 12:09
e295b66
to
78633ff
Compare
github-actions
bot
temporarily deployed
to
staging/pull/1761/bundle-report
May 22, 2024 12:10
Inactive
VeskeR
force-pushed
the
1753/fix-usePresence-connection-closed
branch
from
May 22, 2024 12:13
78633ff
to
2743834
Compare
github-actions
bot
temporarily deployed
to
staging/pull/1761/bundle-report
May 22, 2024 12:13
Inactive
VeskeR
commented
May 22, 2024
ttypic
requested changes
May 22, 2024
VeskeR
force-pushed
the
1753/fix-usePresence-connection-closed
branch
from
May 24, 2024 04:39
2743834
to
2f9fadd
Compare
github-actions
bot
temporarily deployed
to
staging/pull/1761/bundle-report
May 24, 2024 04:40
Inactive
ttypic
requested changes
May 24, 2024
VeskeR
force-pushed
the
1753/fix-usePresence-connection-closed
branch
from
May 24, 2024 12:33
2f9fadd
to
e366379
Compare
ttypic
approved these changes
May 24, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #1753
Also seems to help with #1759 , ideally would confirm with the user that this fix helps with the problem once released.
ably.connection.state
dependency inonUnmount
callback caused the next issue:When
ably.connection.state
is added as a dependency to theonUnmount
callback, changes to the connection state will update this callback, which in turn triggers our mountinguseEffect
hook. This became problematic on page reloads: when the connection state changes toclosed
, theonUnmount
callback updates, and this triggers our mountinguseEffect
hook, which callsonMount
and tries to enter presence. Since the connection is closed at that point, we get a "Connection closed" error. Although it's not critical and doesn't seem to cause any application behavior issues, polluting the log with "Connection closed" errors should be avoided.