Repository navigation
refactor(llc, ui)!: route the read and delivery receipts through the generated client - #3046
Draft
VelikovPetar wants to merge 6 commits into
Conversation
…generated client 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 |
…back Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nto refactor/flu-923_read_receipts_openapi_migration Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nto refactor/flu-923_read_receipts_openapi_migration
…nto refactor/flu-923_read_receipts_openapi_migration # Conflicts: # packages/stream_chat/lib/src/repository/channels_repository.dart
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-923
Github Issue: -
CLA
Description of the pull request
Moves marking channels and threads read and unread, and the delivery receipts, onto the OpenAPI-generated client.
StreamChatClient.markChannelRead,markThreadReadandmarkAllRead, andChannel.markReadandmarkThreadRead, returnResult<MarkReadResponse>instead of throwing.markChannelUnread,markChannelUnreadByTimestampandmarkThreadUnread, andChannel.markUnread,markUnreadByTimestampandmarkThreadUnread, returnResult<void>.markChannelsDeliveredreturnsResult<MarkDeliveredResponse>.MarkChannelsDelivered, the callbackChannelDeliveryReportertakes, returnsFuture<Result<void>>; the reporter keeps the receipts on a failure, and still on a thrown error.Channelguards return a failure instead of throwing: a missing read-events capability, and amarkUnreadon a locally counted channel whose message isn't loaded. An uninitialized channel still throws aStateError.Channel.markReadreturnsMarkReadResponse(duration: '0ms'), where it built an emptyEmptyResponse.MessageDeliverymoves tomodels/request/as a freezed class: notoJson, value equality,copyWith.ChannelsRepositorygains the four operations;channel_mapper.dartgains the envelope mappers andMessageDelivery.toRequest().StreamChatApi.channel.MessageListUnreadController(internal) reads theResultto decide whether to retry a mark-read.DefaultApi.markRead(POST /api/v2/chat/channels/{type}/{id}/read)StreamChatClient.markChannelRead,markThreadReadDefaultApi.markUnread(POST /api/v2/chat/channels/{type}/{id}/unread)StreamChatClient.markChannelUnread,markChannelUnreadByTimestamp,markThreadUnreadDefaultApi.markChannelsRead(POST /api/v2/chat/channels/read)StreamChatClient.markAllReadDefaultApi.markDelivered(POST /api/v2/chat/channels/delivered)StreamChatClient.markChannelsDeliveredMarkReadResponse/MarkDeliveredResponseDurationResponsevoidDeliveredMessagePayloadMessageDelivery(kept)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 for reviewers
MarkReadResponsecarries onlyduration. The API'seventholds a thread whoseparentMessageis aMessageResponse, which needs the message mappers; it's dropped with a TODO and can be added later without a break.MarkChannelsDeliveredis retyped (a break beyond the usualResultone): with the oldFuture<void>signature a failedResultwould have read as success and dropped receipts that were never sent.nulls for the unused fields ({"message_id": null, "thread_id": "…"}); the server treats them as absent.Testing
stream_chatanalyze clean, full suite green (1,912 tests); every package and the sample app analyze clean.generate_plan.py --checkreports 0 problems.client_mark_read_test.dart,client_mark_unread_test.dart,client_mark_all_read_test.dartandclient_mark_channels_delivered_test.dart. The reporter tests cover a failed and a throwing callback.stream_chat_flutter'smessage_list_viewtests pass; the rest of its suite fails only on CI goldens run on macOS, identically on the base branch.Screenshots / Videos
Not applicable: no visible UI change.
🤖 Generated with Claude Code