Repository navigation
refactor(llc)!: route the partial channel and member updates through the generated client - #3044
VelikovPetar wants to merge 13 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 @@
## refactor/flu-882_polls_openapi_migration #3044 +/- ##
============================================================================
+ Coverage 78.48% 78.66% +0.18%
============================================================================
Files 477 481 +4
Lines 29280 29380 +100
============================================================================
+ Hits 22980 23112 +132
+ Misses 6300 6268 -32 ☔ 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>
…nnelModel.copyWith and address the style review Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…date and slow mode docs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…/channel_response_mapper Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…om and promote their parked fields 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/.ChannelModel,MemberandChannelname their custom datacustom(extraData→custom,extraDataStream→customStream,client.channel(custom:)), and it is the wire'scustom, verbatim — the mapper no longer filters it.extraDataare real fields:ChannelModel.disabled,hidden,muted,blocked,truncatedAt,truncatedBy,autoTranslationEnabled,autoTranslationLanguage, andMember.notificationsMuted,status,banFromFutureChannels,futureChannelBanExpires,deletedAt.mergekeeps the same per-field rules.ChannelModel.toJson/Member.toJsonleave out a custom entry named like one of their fields, so it cannot overwrite the field.Memberno longer carries the server-deprecatedroleincustom.truncatedBythrough the users table),customcolumns for channels and members, andMember.banExpiresis now stored (schema1106).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 renamed:
ChannelModel.extraData,Member.extraData,Channel.extraData/extraDataStreamand theextraDataargument ofChannel(…)andclient.channel(…)→custom/customStream, following #3037's rule 9 (each group renames the models it maps first). Noteclient.channel('messaging', custom: {'members': [...]})still creates members on v1; group 11 records how to keep that working on v2's typedChannelInput.members.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.mergerules verified live on v1 and v2: queries always sendhidden/blocked, events omit them (except thechannel.hiddena block sends),mutedis never sent on a channel,truncated_*rides every event once set.auto_translation_*can't be set with a client token, so its rule rests on the backend code.Testing
stream_chat1,956, persistence 314, core 384 green;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