Fix #1256 Socket Mode connection error issue #1265
Merged
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.
This pull request resolves #1256 (and probably #1223 too) by improving the internals of the Socket Mode client code, thanks to @oppokui. This pull request changes the default behavior of the onClose listener not to try to reconnect. Originally, the logic was introduced to let the client get back to online much faster, and it has been working well as long as the server side behaves as the code expects. However, it seems that the server now works differently for some reason. Thus, revisiting the logic should be reasonable. Also, the change should be safe enough for the reasons mentioned in the code comment.
If some users would like to switch back to the previous logic for a certain logic, calling
SocketModeClient#setAutoReconnectOnCloseEnabled(true)
enables them to do so.Category (place an
x
in each of the[ ]
)Requirements
Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you agree to those rules.