feat(llc): add queryUsers to StreamFeedsClient - #111
Conversation
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>
|
Important Review available on request
Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
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>
|
|
||
| ### 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. |
There was a problem hiding this comment.
This entry is too verbose and provides too much details, lets make it a bit compact.
| /// The maximum number of users the API returns in a single page. | ||
| /// | ||
| /// Requests with a higher [limit] are rejected. | ||
| static const maxLimit = 100; |
There was a problem hiding this comment.
Should we add assertion for the maxLimit?
There was a problem hiding this comment.
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> { |
There was a problem hiding this comment.
I was wondering, if we also want to handle user related events here?
Summary
queryUsers()method toStreamFeedsClient(interface + impl) wrapping the generatedDefaultApi.queryUsersendpointFullUserResponseMapperextension touser_data.dartto mapFullUserResponse→UserDatadocs/code_snippets/02_01_querying_users.dartwith examples for name autocomplete, ID filter, and presence queriesDefaultApiinstance as_feedsApifield inFeedsClientImplso methods not covered by a dedicated repository can be called directlyCloses FLU-370
Test plan
melos run analyze— no issuesmelos run format— no changesflutter testinpackages/stream_feeds— 392 tests passdart analyze docs/code_snippets/02_01_querying_users.dart— no issues🤖 Generated with Claude Code