Skip to content

fix(search): clamp the result count to the Slack maximum of 100 - #11

Merged
co42 merged 2 commits into
co42:mainfrom
Hugoch:fix/search-count-clamp
Aug 7, 2026
Merged

co42 merged 2 commits into
co42:mainfrom
Hugoch:fix/search-count-clamp

Conversation

@Hugoch

@Hugoch Hugoch commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

search.messages accepts a count of 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:

-l 100  -> 100 results
-l 101  ->  20 results
-l 200  ->  20 results

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 --limit help text states the ceiling.

After the change, -l 101 and -l 200 both return 100.

Three tests cover the default, the pass-through range and the clamp.

Hugoch added 2 commits August 7, 2026 16:22
`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
Hugoch marked this pull request as ready for review August 7, 2026 14:25
@co42
co42 merged commit 42fed80 into co42:main Aug 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants