Migrate the push preference chat preferences to the generated model - #6677
Conversation
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
SDK Size Comparison 📏
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (3)
💤 Files with no reviewable changes (1)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. WalkthroughThe push preference DTO now uses the shared ChangesPush preference alignment
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This change reuses the existing response model without changing the public push-preference behavior, while adding coverage for all chat-preference toggles. No actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Description checkExplanation The description provides the goal, implementation details, issue reference, testing evidence, and mutation-check results. It omits the UI Changes, contributor checklist, reviewer checklist, and GIF sections, but these are not critical for this non-UI change.
✨ 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. Comment |
andremion
left a comment
There was a problem hiding this comment.
Looks good. One optional test note inline.
|
|
🚀 Available in v7.11.0 |



Goal
Parse a push preference's chat preferences with the generated
ChatPreferencesResponseand delete the hand-writtenDownstreamChatPreferencesDto.Part of AND-1291
Implementation
DownstreamPushPreferenceDto.chat_preferencesatChatPreferencesResponseand dropDownstreamChatPreferencesDto. Its mapper was identical field for field to the existingChatPreferencesResponse.toDomain(), already used byPushPreferencesResponseandChannelPushPreferencesResponse, so the duplicate goes with it and no new mapping code is needed.PushPreferenceDtos.kttoDownstreamPushPreferenceDto.kt, since removing the class leaves a single declaration.PushPreference, with the seven toggles alternating so a preference read from the wrong field cannot pass.chat_preferenceshad no coverage on this path before: neitherMother.randomDownstreamPushPreferenceDtonorUserDtoTestDatapopulated it, and the closest existing test covered a different model while asserting two of the seven toggles.The generated
ChatPreferencesmodel is a different, 8-field type belonging to channel config, not the push preference payload.ChatPreferencesResponsematches the removed DTO exactly, so no field is gained or lost.Testing
chatPreferences.chat_preferencesfrom the mapping, and reading one toggle from the wrong source field, each fail the new test.Summary by CodeRabbit