Repository navigation
refactor(llc)!: route getUnreadCount through the generated client - #3049
Draft
VelikovPetar wants to merge 5 commits into
Draft
VelikovPetar wants to merge 5 commits into
VelikovPetar wants to merge 5 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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 |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3 tasks done
…refactor/flu-935_unread_counts_openapi_migration
…refactor/flu-935_unread_counts_openapi_migration
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Submit a pull request
Linear: FLU-935
Github Issue: -
CLA
Description of the pull request
Moves
StreamChatClient.getUnreadCountonto the OpenAPI-generated client, as new plan group 18 (Unread Counts), split out of group 09 (Users).getUnreadCountreturnsResult<GetUnreadCountResponse>instead of throwing. On success it still updates the current user'stotalUnreadCount,unreadChannelsandunreadThreads(viaresult.onSuccess); a failure leaves them unchanged.GetUnreadCountResponsemoves tomodels/response/as a freezed class with a non-nullduration.UnreadCountsChannel,UnreadCountsThreadandUnreadCountsChannelTypebecome freezed plain models, one per file, withoutfromJson/toJson; they gain value equality andcopyWith.UsersRepository, mirroringUserApi; the mappers go in the existinguser_mapper.dart.StreamChatApi.user.getUnreadCountis removed.DefaultApi.unreadCounts(GET /api/v2/chat/unread)StreamChatClient.getUnreadCountWrappedUnreadCountsResponseGetUnreadCountResponse(kept)UnreadCountsChannel/UnreadCountsThread/UnreadCountsChannelTypeUsersRepository(internal)Why
The migration moves every endpoint onto the generated client, which returns a
Resultfor every call. This one is the smallest unblocked slice: no parameters, a response that matches ours field for field, and nothing persists it.Notes for reviewers
unreadCountsandWrappedUnreadCountsResponsesay nothing a caller needs./unreadand/api/v2/chat/unreadboth mountv1.UnreadCounts; it's gated byClassicUnreadCountsEnabledidentically on both, so the switch changes nothing about who may call it. Not in beta.last_readas epoch nanoseconds rather than RFC 3339; the generated converter handles both.Testing
melos run analyzeclean;stream_chatsuite green (1,910 tests), flutter_core and persistence green.generate_plan.py --checkreports 0 problems.client_get_unread_count_test.dart: the full envelope against a fully populated generated response, the current-user update, the failure without throwing, and the counts left unchanged on failure.Screenshots / Videos
Not applicable: no visible UI change.
🤖 Generated with Claude Code