Skip to content

fix(slack): preserve query params for POST requests - #591

Merged
devjain32 merged 5 commits into
corsairdev:mainfrom
lyydsheep:fix/issue-590-slack-query
Aug 6, 2026
Merged

fix(slack): preserve query params for POST requests#591
devjain32 merged 5 commits into
corsairdev:mainfrom
lyydsheep:fix/issue-590-slack-query

Conversation

@lyydsheep

@lyydsheep lyydsheep commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Fixes #590

Description

Forward query parameters for non-GET Slack requests so pagination fields such as cursor and limit reach conversations.list. The change keeps the shared request client behavior consistent and adds a mocked regression test.

Screenshots / Demos

This is a headless API client; the regression is exercised by the mocked Jest test and the repository CI run: https://github.com/corsairdev/corsair/actions/runs/30911390778

@vercel

vercel Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

@lyydsheep is attempting to deploy a commit to the corsair Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the plugin Changes inside a plugin package label Aug 4, 2026
@greptile-apps

greptile-apps Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Fixes Slack pagination and filtering on conversations.list by preserving query parameters for non-GET requests.

  • Passes caller-supplied query parameters through makeSlackRequest regardless of HTTP method.
  • Adds a mocked regression test confirming POST query forwarding.

Confidence Score: 5/5

The PR appears safe to merge, with the intended POST query forwarding covered by a focused regression test.

The changed client behavior fixes the existing conversations.list call path, while current non-GET callers neither mix query parameters with request bodies nor place sensitive values in URLs.

Important Files Changed

Filename Overview
packages/slack/client.ts Removes the GET-only query restriction so Slack POST endpoints such as conversations.list receive their pagination parameters.
packages/slack/client.test.ts Adds a correctly configured regression test asserting that POST query parameters reach the shared request layer.

Reviews (1): Last reviewed commit: "fix(slack): preserve query params for PO..." | Re-trigger Greptile

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The Slack client now forwards query parameters for all HTTP methods. Tests verify that POST requests preserve cursor and limit parameters.

Changes

Slack query forwarding

Layer / File(s) Summary
Forward POST query parameters
packages/slack/client.ts, packages/slack/client.test.ts
makeSlackRequest passes query parameters for non-GET requests. Jest tests verify POST requests preserve pagination parameters.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The change forwards POST query parameters and adds the required regression test for [#590].
Out of Scope Changes check ✅ Passed All changes are limited to forwarding Slack query parameters and adding the related regression test.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes preserving query parameters for Slack POST requests.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
packages/slack/client.test.ts (1)

27-32: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Assert the POST body in this regression test.

The fixture passes types in body, but the assertion checks only method and query. A later change that drops or rewrites the POST body would still pass this test.

Add the body assertion so the test verifies that types remains separate from the query parameters. This follows the PR objective to preserve types and query parameters in the outbound request.

Suggested assertion
expect.objectContaining({
  method: 'POST',
+ body: { types: 'public_channel' },
  query: { cursor: 'next-page', limit: 100 },
})
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/slack/client.test.ts` around lines 27 - 32, Update the request
assertion in the regression test around mockRequest to also verify the POST body
contains the fixture’s types value, while keeping the existing method and query
checks. Ensure the assertion confirms types remains in body and separate from
query parameters.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/slack/client.test.ts`:
- Around line 27-32: Update the request assertion in the regression test around
mockRequest to also verify the POST body contains the fixture’s types value,
while keeping the existing method and query checks. Ensure the assertion
confirms types remains in body and separate from query parameters.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f02b2499-068d-4d1e-b15a-712ff4748080

📥 Commits

Reviewing files that changed from the base of the PR and between 839b807 and c4484ff.

📒 Files selected for processing (2)
  • packages/slack/client.test.ts
  • packages/slack/client.ts

@Dhirenderchoudhary

Copy link
Copy Markdown
Collaborator

LGTM

@devjain32
devjain32 merged commit cba5547 into corsairdev:main Aug 6, 2026
3 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plugin Changes inside a plugin package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(slack): conversations.list drops cursor and limit on POST

5 participants