Skip to content

fix(llc): forward filter param in Client.queryDrafts#2647

Open
VelikovPetar wants to merge 1 commit into
masterfrom
fix/fix_query_drafts
Open

fix(llc): forward filter param in Client.queryDrafts#2647
VelikovPetar wants to merge 1 commit into
masterfrom
fix/fix_query_drafts

Conversation

@VelikovPetar
Copy link
Copy Markdown

@VelikovPetar VelikovPetar commented May 15, 2026

Submit a pull request

Linear: FLU-491

CLA

  • I have signed the Stream CLA (required).
  • The code changes follow best practices
  • Code changes are tested (add some information if not applicable)

Description of the pull request

Forwards the filter param to the API.queryDrafts.

Screenshots / Videos

Before After
img img

Summary by CodeRabbit

  • Bug Fixes
    • Fixed draft message queries to properly apply filter parameters when querying the backend.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 150c2031-1ddf-4a06-a4ff-1e847954a7cd

📥 Commits

Reviewing files that changed from the base of the PR and between 1168767 and 120e28f.

📒 Files selected for processing (3)
  • packages/stream_chat/CHANGELOG.md
  • packages/stream_chat/lib/src/client/client.dart
  • packages/stream_chat/test/src/client/client_test.dart

📝 Walkthrough

Walkthrough

StreamChatClient.queryDrafts is fixed to forward the optional filter argument to the backend API call (previously forwarded only sort and pagination). The test is updated to verify this behavior with explicit filter, sort, and pagination parameters.

Changes

Filter Parameter Fix

Layer / File(s) Summary
Filter argument forwarding in queryDrafts
packages/stream_chat/lib/src/client/client.dart, packages/stream_chat/CHANGELOG.md
The queryDrafts method now includes filter: filter in the _chatApi.message.queryDrafts(...) call. The changelog documents this fix under "🐞 Fixed" in the Upcoming section.
Test coverage for filter parameter
packages/stream_chat/test/src/client/client_test.dart
The queryDrafts test now explicitly defines filter (by channel_cid), sort (descending by created_at), and pagination parameters; mocks the API call with those arguments; and verifies the API is called exactly once with the expected parameters.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A filter was lost in the drafts, so sad,
But now it flows through to the API—not bad!
The test sings along with each sort and each page,
A small little fix that's just right for this stage. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely describes the main change: forwarding the filter parameter in Client.queryDrafts, which is confirmed by all three modified files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/fix_query_drafts

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@VelikovPetar VelikovPetar marked this pull request as ready for review May 15, 2026 07:47
@codecov
Copy link
Copy Markdown

codecov Bot commented May 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.74%. Comparing base (1168767) to head (120e28f).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2647   +/-   ##
=======================================
  Coverage   64.74%   64.74%           
=======================================
  Files         422      422           
  Lines       26438    26438           
=======================================
+ Hits        17116    17118    +2     
+ Misses       9322     9320    -2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant