Keep the chat preferences when mapping a channel push preference response - #6639
Keep the chat preferences when mapping a channel push preference response#6639gpunto wants to merge 1 commit into
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: Pro Plus Run ID: 📒 Files selected for processing (3)
WalkthroughChannel push preference responses now include optional chat preferences. Domain mapping preserves these preferences, and tests verify nested toggles, channel levels, and null handling. ChangesChannel push preferences
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The change preserves channel chat preferences in push-preference responses and adds focused mapping coverage; no actionable merge-blocking risk remains beyond normal checks. Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 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 |



Goal
Channel chat preferences were dropped when reading a push preference response, so
PushPreference.chatPreferenceswas always null for a channel.Part of AND-1291
Implementation
ChannelPushPreferencesResponse, which was vendored before the spec publishedchat_preferences, so the field was absent from the model.null.Regressed in #6628, which is not in a release yet, so no shipped version is affected. The
hand-written
DownstreamPushPreferenceDtocarriedchat_preferencesand served both the user andthe channel level. It was replaced by two generated models, and only the user-level one kept the
field. The old DTO is still used for
ChannelResponse.push_preferences, which is why a channel readback through
queryChannelhad the preferences while the write response did not.Affects
setChannelChatPreferences,setChannelPushPreferenceandsnoozeChannelPushNotifications.setChannelChatPreferenceswas the worst case: a caller could not read back the toggles it had just set.A sweep for the same pattern (a mapper filling a domain field with a literal because the model has no
source for it) turned up one older instance, filed as AND-1391. It predates this migration and is not fixed here.
Testing
DomainMappingTestcovers the mapping and the null case. The first test fails without the fix.channel back through
queryChannel, which maps the same server state through the older hand-written DTO.Both paths now return identical toggles; before the fix they disagreed. Also confirmed that setting a
level clears the preferences, which is the documented behaviour, and that snoozing sets
disabled_until.Summary by CodeRabbit