Migrate the query channel request to the generated ChannelGetOrCreateRequest - #6743
Conversation
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
SDK Size Comparison 📏
|
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (20)
💤 Files with no reviewable changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review. WalkthroughChannel queries now map through ChangesChannel query request mapping
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Refactor Sequence Diagram(s)sequenceDiagram
participant QueryChannelRequest
participant DtoMapping
participant MoshiChatApi
participant ChannelApi
QueryChannelRequest->>DtoMapping: convert to ChannelGetOrCreateRequest
DtoMapping->>MoshiChatApi: provide mapped request
MoshiChatApi->>ChannelApi: send mapped request
Suggested reviewers: Merge Risk: ⚪ Minimal · up to No actionable issue remains in the channel-query request migration; it is ready to merge after normal checks. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The existing channel routes and connection handling remain in place, with no demonstrated expansion of access. One previously transmissible message-pagination field is now omitted for callers who set it directly, creating a limited compatibility risk. Retained concerns
Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. A rabbit checks the fields in line, Comment |
andremion
left a comment
There was a problem hiding this comment.
Looks good. One question inline, not blocking.
|
|
🚀 Available in v7.13.0 |



Goal
Send the query channel request (query, watch and create channel) with the generated
ChannelGetOrCreateRequest.Part of AND-1291
Implementation
QueryChannelRequesttoChannelGetOrCreateRequeston both query channel routes, anddelete the hand-written request.
ChannelInput.customand a newChannelInputAdapterflattens it back intodata, asupdateChannelalready does. Our routes store undeclareddatakeys as custom data, so anested
customobject would become a custom field namedcustom.Dateor an ISO string, asbefore.
ChannelMemberRequest(user_idoptional,useris the newMemberUserRequest), with aflattening adapter for
MemberUserRequest.ChannelQueryKeykeeps the request fields itself instead of the deleted request.Notes
The
messages,membersandwatchersmaps are public, so apps can put any key in them. Keys the typedpagination models don't declare are no longer sent. The backend ignores all of them except
messages.offset, which it reads but keeps out of the spec; the SDK has no builder that sets it.Testing
The request on the wire is unchanged for every shape the SDK builds: the old and new models serialize to
the same JSON, key order aside.
QueryChannelRequestSerializationTestpins the payload, every paginationkey (dates as
Dateand as strings) and flat custom data.On a device: created a channel with a name, an image and nested custom data, read it back flat, paged
messages in each direction and by date, paged members and watchers with an offset, and created a distinct
channel without an id.
🤖 Generated with Claude Code