Skip to content

fix(socket_mode): send frames over 64 KB with the 64-bit length form - #2046

Merged
WilliamBergamin merged 2 commits into
slackapi:mainfrom
WilliamBergamin:fix/socket-mode-64bit-send
Nov 16, 2026
Merged

WilliamBergamin merged 2 commits into
slackapi:mainfrom
WilliamBergamin:fix/socket-mode-64bit-send

Conversation

@WilliamBergamin

Copy link
Copy Markdown
Contributor

Summary

This pull request lets the builtin Socket Mode and RTM v2 clients send frames larger than 64 KB.

  • _build_data_frame_for_sending only had the 7-bit and 16-bit length forms, so any payload over 65535 bytes raised struct.error: 'H' format requires 0 <= number <= 65535. A large ack() payload, such as a response_action with a full view, could hit this.
  • Payloads over 65535 bytes now use the 64-bit form (length byte 127, !Q), as RFC 6455 section 5.2 specifies. The receive path already handles it.

Testing

The new tests fail on main and pass on this branch. They decode the frame header and unmask the body:

  • 65535 bytes still uses the 16-bit form.
  • 65536 bytes uses the 64-bit form.

Category

  • slack_sdk.web.WebClient (sync/async) (Web API client)
  • slack_sdk.webhook.WebhookClient (sync/async) (Incoming Webhook, response_url sender)
  • slack_sdk.socket_mode (Socket Mode client)
  • slack_sdk.signature (Request Signature Verifier)
  • slack_sdk.oauth (OAuth Flow Utilities)
  • slack_sdk.models (UI component builders)
  • slack_sdk.scim (SCIM API client)
  • slack_sdk.audit_logs (Audit Logs API client)
  • slack_sdk.rtm_v2 (RTM client)
  • /docs (Documents)
  • /tutorial (PythOnBoardingBot tutorial)
  • tests/integration_tests (Automated tests for this library)

Requirements

  • I've read and understood the Contributing Guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I have signed the Salesforce CLA (required before your PR can be reviewed or merged).
  • I've run python3 -m venv .venv && source .venv/bin/activate && ./scripts/run_validation.sh after making the changes.

🤖 Generated with Claude Code

WilliamBergamin and others added 2 commits November 16, 2026 15:00
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@codecov

codecov Bot commented Nov 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.46%. Comparing base (6d3569e) to head (ab3021e).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2046      +/-   ##
==========================================
+ Coverage   84.45%   84.46%   +0.01%     
==========================================
  Files         118      118              
  Lines       14039    14042       +3     
==========================================
+ Hits        11856    11861       +5     
+ Misses       2183     2181       -2     

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

@WilliamBergamin WilliamBergamin self-assigned this Nov 16, 2026
@WilliamBergamin
WilliamBergamin marked this pull request as ready for review November 16, 2026 20:38
@WilliamBergamin
WilliamBergamin requested a review from a team as a code owner November 16, 2026 20:38
@WilliamBergamin WilliamBergamin added bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented semver:patch socket-mode labels Nov 16, 2026
@WilliamBergamin WilliamBergamin added this to the 3.47.1 milestone Nov 16, 2026

@zimeg zimeg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🐍 LGTM! Thanks for catching this @WilliamBergamin, large ack() payloads will send now.

@WilliamBergamin
WilliamBergamin merged commit 33288b9 into slackapi:main Nov 16, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented semver:patch socket-mode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants