Repository navigation
fix(socket-mode): open the replacement connection before closing the old one on refresh #2821
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
Merged
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
e9f103e
fix(socket-mode): open the replacement connection before closing the …
WilliamBergamin 827ce21
Merge branch 'fix-issue-2656' into fix-issue-2767
WilliamBergamin 5d010e6
fix(socket-mode): skip the reconnect backoff only for Slack's refresh…
WilliamBergamin fe6d993
refactor(socket-mode): name the replacement and retiring-socket steps
WilliamBergamin ae4cff4
refactor(socket-mode): drop the retire() docstring
WilliamBergamin 63544b1
refactor(socket-mode): shorten the retiringWebsocket docstring
WilliamBergamin 5017bc2
refactor(socket-mode): await the replacement start() in a try/catch
WilliamBergamin e493bcf
fix(socket-mode): open a replacement on every disconnect reason
WilliamBergamin f1d0382
Merge branch 'fix-issue-2656' into fix-issue-2767
WilliamBergamin f127bf7
Merge remote-tracking branch 'origin/fix-issue-2656' into fix-issue-2767
WilliamBergamin e542c96
refactor(socket-mode): drop the close guard the identity check made dead
WilliamBergamin 5c5a8b6
Merge remote-tracking branch 'origin/fix-issue-2767' into fix-issue-2767
WilliamBergamin 2adb58e
fix(socket-mode): close instead of overlapping on link_disabled
WilliamBergamin 791caeb
fix(socket-mode): only act on hello from the current connection
WilliamBergamin c28f8c3
Merge branch 'fix-issue-2656' into fix-issue-2767
WilliamBergamin ea92e5c
fix(socket-mode): skip a replacement while one is in flight, or from …
WilliamBergamin dca9696
fix(socket-mode): keep a failed replacement as loud as a failed recon…
WilliamBergamin 2e2669a
test(socket-mode): pin overlapping refreshes to two connections
WilliamBergamin c7e980d
docs(socket-mode): describe overlapping refreshes in the changeset
WilliamBergamin 4028603
Merge branch 'fix-issue-2656' into fix-issue-2767
WilliamBergamin 3934ce6
Merge branch 'fix-issue-2656' into fix-issue-2767
WilliamBergamin 554aef5
Merge branch 'fix-issue-2656' into fix-issue-2767
WilliamBergamin c923238
fix(socket-mode): keep the old connection open until Slack sends it d…
WilliamBergamin 0f05a1e
style(socket-mode): realign the README lifecycle table
WilliamBergamin 88bf02f
test(socket-mode): wait for the replacement instead of a fixed sleep
WilliamBergamin e7efe98
Merge branch 'fix-issue-2656' into fix-issue-2767
WilliamBergamin 3d17211
docs(socket-mode): note the two-connection overlap during a refresh
WilliamBergamin f4dd1f4
Merge branch 'fix-issue-2656' into fix-issue-2767
WilliamBergamin d381bb4
test(socket-mode): pin the guards that ignore stale disconnect messages
WilliamBergamin e983ce4
refactor(socket-mode): drop the hello identity check
WilliamBergamin 5e1e422
test(socket-mode): trim the refresh tests to what they pin
WilliamBergamin 49629b1
refactor(socket-mode): drop comments the names already carry
WilliamBergamin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| "@slack/socket-mode": patch | ||
| --- | ||
|
|
||
| Fix a 5 to 12 second gap without a connection each time Slack refreshes a Socket Mode connection ([#2767](https://github.com/slackapi/node-slack-sdk/issues/2767)). On a `disconnect` message the client now opens the replacement connection right away, without a reconnect backoff, and leaves the old connection open until Slack sends it a `disconnect` message too, so payloads Slack still sends on it during the switch are received instead of dropped. Each payload is acknowledged on the connection it arrived on. While the replacement is being opened, the current connection keeps serving, and overlapping `disconnect` messages open one replacement. A replacement that fails for good rejects with its cause, as a failed reconnect does. A `link_disabled` message still closes the connection first, since a replacement can't connect while Socket Mode is off. | ||
|
|
||
| **Note:** during each refresh, a client now holds two connections for about 60 seconds, until Slack sends the old one its own `disconnect` (`refresh_requested`, about a minute after the `warning`). Both count toward Slack's limit of 10 open Socket Mode connections per app, so apps that run many instances at once should leave room for one extra connection per instance while they refresh. |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
praise: Thanks for covering
disconnect()mid-refresh and the back to back disconnect messages. Those are the races I'd have worried about most.