Skip to content

feat(llc): add queryUsers to StreamFeedsClient - #111

Open
renefloor wants to merge 7 commits into
mainfrom
renefloor/flu-370-add-code-snippets-for-queryusers-in-sdks-and-update-on-new
Open

feat(llc): add queryUsers to StreamFeedsClient#111
renefloor wants to merge 7 commits into
mainfrom
renefloor/flu-370-add-code-snippets-for-queryusers-in-sdks-and-update-on-new

Conversation

@renefloor

Copy link
Copy Markdown
Collaborator

Summary

  • Added queryUsers() method to StreamFeedsClient (interface + impl) wrapping the generated DefaultApi.queryUsers endpoint
  • Added FullUserResponseMapper extension to user_data.dart to map FullUserResponseUserData
  • Added docs/code_snippets/02_01_querying_users.dart with examples for name autocomplete, ID filter, and presence queries
  • Stored DefaultApi instance as _feedsApi field in FeedsClientImpl so methods not covered by a dedicated repository can be called directly

Closes FLU-370

Test plan

  • melos run analyze — no issues
  • melos run format — no changes
  • flutter test in packages/stream_feeds — 392 tests pass
  • dart analyze docs/code_snippets/02_01_querying_users.dart — no issues

🤖 Generated with Claude Code

Expose the generated DefaultApi.queryUsers endpoint via a public
queryUsers() method on StreamFeedsClient. Adds FullUserResponseMapper
to map FullUserResponse to the domain UserData model.

Closes FLU-370

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@renefloor
renefloor requested a review from a team as a code owner June 17, 2026 12:53
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Important

Review available on request

  • 🔍 Trigger review

Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment @coderabbitai review to review the latest changes. For a full review, comment @coderabbitai full review.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1fa318a1-69ac-4df3-840d-23ba675d07b5

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch renefloor/flu-370-add-code-snippets-for-queryusers-in-sdks-and-update-on-new

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.

@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.91%. Comparing base (a1590dd) to head (2a7f700).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
packages/stream_feeds/lib/src/state/user_list.dart 92.30% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #111      +/-   ##
==========================================
+ Coverage   85.53%   85.91%   +0.37%     
==========================================
  Files         124      128       +4     
  Lines        4342     4479     +137     
==========================================
+ Hits         3714     3848     +134     
- Misses        628      631       +3     

☔ View full report in Codecov by Harness.
📢 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.

renefloor and others added 2 commits June 18, 2026 10:21
Add unit tests for queryUsers() client method and FullUserResponseMapper.toModel().
Also adds createDefaultFullUserResponse and createDefaultQueryUsersResponse test helpers.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@renefloor
renefloor marked this pull request as draft June 18, 2026 13:45
@renefloor
renefloor marked this pull request as ready for review July 9, 2026 11:18
Comment thread packages/stream_feeds/lib/src/feeds_client.dart Outdated
Comment thread packages/stream_feeds/CHANGELOG.md Outdated

### New methods
- Added `queryUsers` to `StreamFeedsClient` for searching users by filter conditions, sort, and pagination.
- Added `userList` to `StreamFeedsClient`, returning a `UserList` state object for querying users. Takes a `UsersQuery` with type-safe `UsersFilterField`/`UsersSortField` filtering and sorting, plus an `includeDeactivatedUsers` option. Users are paginated with `limit`/`offset` (`UserListState.nextOffset` / `canLoadMore`) because the users endpoint returns no page cursors.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This entry is too verbose and provides too much details, lets make it a bit compact.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

fixed: 2a7f700

Comment on lines +38 to +41
/// The maximum number of users the API returns in a single page.
///
/// Requests with a higher [limit] are rejected.
static const maxLimit = 100;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we add assertion for the maxLimit?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

fixed: 2a7f700

@renefloor
renefloor requested a review from xsahil03x August 18, 2026 13:56

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we need a separate test file for users query? It should already be tested with the user_list_test right.

///
/// Provides methods to update the user list state in response to data changes
/// from the Stream Feeds API.
class UserListStateNotifier extends StateNotifier<UserListState> {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I was wondering, if we also want to handle user related events here?

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