Skip to content

refactor(llc, core)!: route hide, show and delete channel through the generated client - #3045

Open
VelikovPetar wants to merge 7 commits into
refactor/channel_response_mapperfrom
refactor/flu-911_channel_lifecycle_openapi_migration
Open

VelikovPetar wants to merge 7 commits into
refactor/channel_response_mapperfrom
refactor/flu-911_channel_lifecycle_openapi_migration

Conversation

@VelikovPetar

@VelikovPetar VelikovPetar commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Linear: FLU-911

What

Moves hiding, showing and deleting a channel onto the OpenAPI-generated client.

  • StreamChatClient.hideChannel, showChannel and deleteChannel, and Channel.hide, show and delete, return Result<HideChannelResponse>, Result<ShowChannelResponse> and Result<DeleteChannelResponse> instead of throwing.
  • StreamChannelListController.deleteChannel (flutter_core) returns the Result too.
  • ChannelsRepository gains the three operations; channel_mapper.dart gains the envelope mappers. The deleted channel goes through the existing ChannelResponse mapper.
  • New freezed envelopes in models/response/. DeleteChannelResponse.channel is nullable, as the spec declares it.
  • StreamChatApi.channel.hideChannel, showChannel and deleteChannel are removed.
  • Sample app: the three delete flows check the Result and stay on the screen when the delete fails, as they did when it threw.
Generated Public
DefaultApi.hideChannel (POST /api/v2/chat/channels/{type}/{id}/hide) StreamChatClient.hideChannel
DefaultApi.showChannel (POST /api/v2/chat/channels/{type}/{id}/show) StreamChatClient.showChannel
DefaultApi.deleteChannel (DELETE /api/v2/chat/channels/{type}/{id}) StreamChatClient.deleteChannel
HideChannelResponse / ShowChannelResponse / DeleteChannelResponse same names (ours, freezed)

Why

The calls take the API's envelopes rather than EmptyResponse, so a field the API adds later reaches callers without another break. The v2 routes are the same backend handlers as v1, and none is gated or in beta.

Notes

  • hard_delete is not exposed: the server refuses it from a client-side token, and v10 never sent it.
  • showChannel now sends no body where v1 sent {}; the server accepts both.
  • The read and delivery receipts (markRead family, markAllRead, markChannelsDelivered) are not part of this PR.
  • Plan: group 16 "Channel Lifecycle" is split out of group 11.

Testing

  • stream_chat analyze clean, full suite green (1,905 tests). flutter_core's controller tests pass, and the other packages and the sample app analyze clean. generate_plan.py --check reports 0 problems.
  • New client tests: client_hide_channel_test.dart, client_show_channel_test.dart and client_delete_channel_test.dart.
  • Live v1 vs v2 parity on the demo app, on throwaway channels deleted afterwards. Hide (with and without clear_history), show and delete answer the same. The deleted channel maps identically to the v1 decode, and hard_delete is refused on both.

🤖 Generated with Claude Code

… generated client

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 59a005ea-cce8-4498-a434-d5fdc0334e59

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

VelikovPetar and others added 3 commits October 6, 2026 08:58
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…elete fails

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d they pass on

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@VelikovPetar
VelikovPetar marked this pull request as ready for review October 6, 2026 07:15
@codecov

codecov Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.13%. Comparing base (881d3b9) to head (f844b96).

Additional details and impacted files
@@                        Coverage Diff                        @@
##           refactor/channel_response_mapper    #3045   +/-   ##
=================================================================
  Coverage                             78.12%   78.13%           
=================================================================
  Files                                   473      476    +3     
  Lines                                 29325    29328    +3     
=================================================================
+ Hits                                  22911    22915    +4     
+ Misses                                 6414     6413    -1     

☔ 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.

VelikovPetar and others added 3 commits October 6, 2026 15:42
…_channel_lifecycle_openapi_migration

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant