Fix unable to update delivery receipts privacy setting#6178
Fix unable to update delivery receipts privacy setting#6178VelikovPetar merged 1 commit intodevelopfrom
Conversation
Co-Authored-By: Claude <[email protected]>
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
SDK Size Comparison 📏
|
|
WalkthroughThis pull request adds support for delivery receipts within privacy settings across the Stream Chat Android client. Changes include introducing DTO mapping for DeliveryReceipts, updating PrivacySettings.toDto() to include delivery_receipts, modifying SocketFactory's privacy settings reduction logic to handle the new property, and extending test coverage to validate the new mappings and socket factory behavior. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
stream-chat-android-client/src/test/java/io/getstream/chat/android/client/socket/SocketFactoryTest.kt (1)
145-176: Both new privacy-settings cases only coverexpireToken = false.The existing test matrix already crosses each user shape with both token states (lines 103–130 include
expireToken = truecases). The new cases with privacy settings are only exercised withexpireToken = false, leaving theloadSyncTokenpath untested for these shapes. Consider adding aexpireToken = truevariant for at least one of the new scenarios to keep coverage consistent.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@stream-chat-android-client/src/test/java/io/getstream/chat/android/client/socket/SocketFactoryTest.kt` around lines 145 - 176, The new privacy-settings test cases only exercise expireToken = false; add at least one duplicate case (using the same randomUser shape or one of the two privacy-settings variants) with expireToken = true so the loadSyncToken branch is exercised; specifically, duplicate one of the Arguments.of entries that builds SocketFactory.ConnectionConf.UserConnectionConf(...) (the case using buildFullUserJson(it, it.id) and headersUtil.buildSdkTrackingHeaders()) but set the first argument to true to cover the expireToken=true path.
ℹ️ Review info
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (4)
stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/mapping/DtoMapping.ktstream-chat-android-client/src/main/java/io/getstream/chat/android/client/socket/SocketFactory.ktstream-chat-android-client/src/test/java/io/getstream/chat/android/client/api2/mapping/DtoMappingTest.ktstream-chat-android-client/src/test/java/io/getstream/chat/android/client/socket/SocketFactoryTest.kt
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@stream-chat-android-client/src/test/java/io/getstream/chat/android/client/socket/SocketFactoryTest.kt`:
- Line 101: Add a short KDoc or inline comment immediately above the
`@Suppress`("MaxLineLength", "LongMethod") annotation in SocketFactoryTest (the
suppression on the test method/class) that documents why the LongMethod
suppression is necessary (e.g., the test aggregates many scenarios, readability
trade-off, references to a tracking issue or ticket if applicable), states the
scope (which method/class it applies to), and how/when it should be revisited;
keep the comment concise and specific so the suppression is justified per coding
guidelines.
---
Nitpick comments:
In
`@stream-chat-android-client/src/test/java/io/getstream/chat/android/client/socket/SocketFactoryTest.kt`:
- Around line 145-176: The new privacy-settings test cases only exercise
expireToken = false; add at least one duplicate case (using the same randomUser
shape or one of the two privacy-settings variants) with expireToken = true so
the loadSyncToken branch is exercised; specifically, duplicate one of the
Arguments.of entries that builds
SocketFactory.ConnectionConf.UserConnectionConf(...) (the case using
buildFullUserJson(it, it.id) and headersUtil.buildSdkTrackingHeaders()) but set
the first argument to true to cover the expireToken=true path.
...at-android-client/src/test/java/io/getstream/chat/android/client/socket/SocketFactoryTest.kt
Show resolved
Hide resolved
|
🚀 Available in v6.32.4 |



Goal
Fix the issue where delivery receipts privacy setting was not being sent to the backend when users attempted to update their privacy settings (AND-1078).
Implementation
delivery_receiptsfield mapping inPrivacySettings.toDto()inDtoMapping.ktDeliveryReceipts.toDto()extension function to convert domain model to DTOdelivery_receiptsserialization inSocketFactory.reducePrivacySettings()for WebSocket connection🎨 UI Changes
No UI changes.
Testing
DtoMappingTest.ktandSocketFactoryTest.ktSummary by CodeRabbit
New Features
Tests