Repository navigation
refactor(llc)!: route the partial channel and member updates through the generated client - #3044
VelikovPetar wants to merge 9 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the generated client Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…owMode and disableSlowMode Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v11 #3044 +/- ##
======================================
Coverage ? 78.12%
======================================
Files ? 473
Lines ? 29325
Branches ? 0
======================================
Hits ? 22911
Misses ? 6414
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Linear: FLU-910
What
Moves the partial channel and member updates onto the OpenAPI-generated client, and adds the mappers from the generated channel and member types to our
ChannelModel/Member.StreamChatClient.updateChannelPartial,enableSlowModeanddisableSlowMode, andChannel.updatePartial,updateName,updateImage,enableSlowModeanddisableSlowMode, returnResult<UpdateChannelPartialResponse>instead of throwing.StreamChatClient.updateMemberPartial,pinChannel,unpinChannel,archiveChannelandunarchiveChannel, andChannel.pin,unpin,archiveandunarchive, returnResult<UpdateMemberPartialResponse>. TheChannelmethods return the envelope instead of the bareMember.ChannelsRepositoryoverDefaultApi;channel_mapper.dartmapsChannelResponse,ChannelMemberResponse,ChannelConfigWithInfo,CommandandChatPreferences; freezed envelopes inmodels/response/.ChannelModelgainstruncatedBy,autoTranslationEnabledandautoTranslationLanguage, andMembergainsnotificationsMuted,status,banFromFutureChannels,futureChannelBanExpiresanddeletedAt. They are getters overextraData, like the existingmutedandblocked, socopyWith,mergeand the offline cache behave as before.Member.banExpiresis now stored (schema1104).DefaultApi.updateChannelPartial(PATCH /api/v2/chat/channels/{type}/{id})StreamChatClient.updateChannelPartialDefaultApi.updateMemberPartial(PATCH /api/v2/chat/channels/{type}/{id}/member)StreamChatClient.updateMemberPartialUpdateChannelPartialResponseUpdateChannelPartialResponse(ours, freezed)UpdateMemberPartialResponseUpdateMemberPartialResponse(ours, freezed)ChannelResponse/ChannelMemberResponseChannelModel/MemberChannelConfigWithInfo/Command/ChatPreferencesChannelConfig/Command/ChatPreferencesThis PR renames instead of keeping the v10 names:
PartialUpdateChannelResponse→UpdateChannelPartialResponsePartialUpdateMemberResponse→UpdateMemberPartialResponseStreamChatClient.partialMemberUpdate→updateMemberPartialStreamChatClient.enableSlowdown/disableSlowdown→enableSlowMode/disableSlowModeWhy: every call site already changes for
Result, the envelopes and the member method now share the API's naming scheme, and the slow-mode pair matches theChannelhelpers andChannelCapability.slowMode(the spec has no slow-mode operation). The alternative is keeping the v10 names, as earlier batches did; push back here if you prefer that. Names settled by earlier groups (getAppSettings,AppSettings,UploadConfig) are untouched. The plan's README rule 2 and the migration skill are updated to match.Also removed:
MemberUpdatePayloadandMemberUpdateType. They only namedpinnedandarchived;updateMemberPartialtakes the map directly.Notes
/member) is a different handler from v1's (/member/{user_id}) but behaves the same for client-side calls. Neither is feature-flagged or in beta.UpdateChannelPartialResponse.channelandUpdateMemberPartialResponse.channelMemberare nullable, as the spec declares them.membersis non-null; the server sends[]for an empty channel.updateChannelandChannel.updatestill return a plainFuturethat throws aStreamChatExceptionon failure. They move toResultwith group 10's message mappers, because their request and response carry aMessage. Until then the partial and full updates report failures differently, and the migration guide says so.disableSlowModesendsunset: ['cooldown'], which the server rejects on both v1 and v2; it is fixed separately.Testing
stream_chatanalyze clean, full suite green (1,904 tests); the other packages and the sample app analyze clean;generate_plan.py --checkreports 0 problems.client_update_channel_partial_test.dartandclient_update_member_partial_test.dart, with shared fixtures infakes.dart.v11against the live demo app, on throwaway channels deleted afterwards: channel set/unset, slow mode, pin/unpin/archive/unarchive, custom fields, invited/banned/shadow-banned members and the error cases. Only the documented differences showed up.🤖 Generated with Claude Code