Skip to content
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

Fix #1256 Socket Mode connection error issue #1265

Merged
merged 1 commit into from
Jan 11, 2024

Conversation

seratch
Copy link
Member

@seratch seratch commented Jan 11, 2024

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 [ ])

  • bolt (Bolt for Java)
  • bolt-{sub modules} (Bolt for Java - optional modules)
  • slack-api-client (Slack API Clients)
  • slack-api-model (Slack API Data Models)
  • slack-api-*-kotlin-extension (Kotlin Extensions for Slack API Clients)
  • slack-app-backend (The primitive layer of Bolt for Java)

Requirements

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you agree to those rules.

@seratch seratch added bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented project:bolt project:slack-api-client project:slack-api-client labels Jan 11, 2024
@seratch seratch added this to the 1.37.0 milestone Jan 11, 2024
@seratch seratch self-assigned this Jan 11, 2024
Copy link

codecov bot commented Jan 11, 2024

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (5afc51b) 74.32% compared to head (97f9617) 74.36%.

Files Patch % Lines
...va/com/slack/api/socket_mode/SocketModeClient.java 0.00% 5 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1265      +/-   ##
============================================
+ Coverage     74.32%   74.36%   +0.04%     
- Complexity     4121     4126       +5     
============================================
  Files           443      443              
  Lines         13078    13087       +9     
  Branches       1322     1323       +1     
============================================
+ Hits           9720     9732      +12     
+ Misses         2586     2582       -4     
- Partials        772      773       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@seratch seratch merged commit 912698b into slackapi:main Jan 11, 2024
5 checks passed
@seratch seratch deleted the issue-1256-socket-mode branch January 11, 2024 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented project:bolt project:slack-api-client project:slack-api-client
Projects
None yet
Development

Successfully merging this pull request may close these issues.

busy to open/close a connection when running slack socket mode for days
1 participant