Repository navigation
feat: expose Socket Mode dispatch timing to Bolt middleware - #1678
Open
Adam-Schildkraut wants to merge 5 commits into
Open
Adam-Schildkraut wants to merge 5 commits into
Adam-Schildkraut wants to merge 5 commits into
Conversation
Contributor
Author
|
One thing I noticed while working on this: the two The listener type and its state already live in the shared |
Contributor
Author
|
Sorry for the scary PR size! Production changes are +161/−31, but the 4 |
Adam-Schildkraut
marked this pull request as ready for review
November 5, 2026 05:21
This branch has not been deployed
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
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.
Socket Mode messages can wait in the receive queue and Bolt's handler executor before middleware runs, so existing timings miss the delay before handling starts.
Both Bolt adapters expose the envelope ID and optional dispatch delay on the existing
Request, so apps can record them in ordinaryapp.use(...)middleware. The delay includes both SDK queues and parsing; custom queues without receive timestamps reportnull. Middleware keeps its normal ordering and error handling, so metrics code must isolate its own recording failures. Acknowledgement and shutdown behavior are unchanged.Existing
processMessage(String)overrides, string listeners and custom queues remain supported. A package-private context carries timing through the existing string dispatch hook, then listeners and Bolt receive it explicitly. The context is cleared after use and on failure. Custom overrides that forward processing to another thread report unknown timing; they continue handling messages as before.New tests cover both queue delays, duplicate deliveries, unknown timing, existing dispatch overrides, cleanup after failures and nested calls, and configured error-handler acknowledgements. Local websocket tests cover all three backends. The focused suite passes on Java 8 (11 tests) and Java 17 (13 tests, including Jakarta), using AWS dependency 2.29.24 within the declared range for local verification. The full SDK suite and live Slack traffic have not been tested.
Category (place an
xin 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.