fix(search): clamp the result count to the Slack maximum of 100 - #11
Merged
Merged
Conversation
`search.messages` accepts a `count` of 100 at most. Slack answers a higher value with its own default of 20, so `-l 200` returns 20 results while `-l 100` returns 100. The larger request gives the smaller answer, and nothing reports it. The count is now clamped to 100. A request above that prints a status line that points at `--page`, which is how to read further. The `--limit` help text states the ceiling.
CI runs clippy with `-D warnings`, so this conversion fails the build. The same one-line change is in co42#10; whichever lands first makes it a no-op for the other.
Hugoch
marked this pull request as ready for review
August 7, 2026 14:25
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.
Summary
search.messagesaccepts acountof 100 at most. Slack answers a higher value with its own default of 20, so a larger request returns a smaller answer and nothing reports it:This is easy to read as a quiet period rather than a truncated page, so results go missing without any sign.
The count is now clamped to 100. A request above that prints a status line pointing at
--page, and the--limithelp text states the ceiling.After the change,
-l 101and-l 200both return 100.Three tests cover the default, the pass-through range and the clamp.