Migrate the poll nested option and vote types to the generated models - #6684
Migrate the poll nested option and vote types to the generated models#6684gpunto 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: Advanced Run ID: 📒 Files selected for processing (10)
💤 Files with no reviewable changes (3)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. WalkthroughThe poll pipeline now uses network response models for options and votes. The obsolete option DTO and Moshi adapter were removed. Domain mappings, test factories, parser tests, and poll fixtures were updated. ChangesPoll response model migration
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to Poll options and votes now use the generated response models while retaining domain mapping and parsing coverage for option data, vote users, and answers. No merge-blocking behavior risk is identified. Suggested reviewers: 🚥 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 maps each poll with care Comment |



Goal
Adopt the generated
PollOptionResponseDataandPollVoteResponseDatafor the nested types ofDownstreamPollDto.Part of AND-1291
Implementation
options,latest_answers,latest_votes_by_optionandown_votesonDownstreamPollDtoto thegenerated models. Both mappers already existed from the
PollResponseDataslice, and field parity isexact including nullability, so no new mapping code was needed.
DownstreamPollOptionDtowith itsCustomObjectDtoAdapter, its registration, and both itshand-written mappers. The generated
PollOptionResponseDataAdaptercollects root-level custom keys intocustomthe same way, so option custom data keeps reachingOption.extraData.DownstreamVoteDtostays: four poll events still declare it.Notes
The only strictness change is the nested user.
UserResponserequirescreated_at,updated_atandlanguagewhereDownstreamUserDtodid not, so the vote users in the poll fixtures gained them.Testing
OptionParsingTestretargeted to the generated model, andDomainMappingTestcovers the poll mappingwith custom data on an option, a user on a vote, and an answer.
test or cannot compile.
DownstreamPollDto: the poll on a sendresponse, the poll on a message fetch with
own_votes,latest_votes_by_optionandlatest_answersallpopulated, and the
poll.vote_casted,poll.answer_casted,poll.vote_removed,poll.closedandpoll.deletedevents. Every field of the resultingPoll,VoteandAnswerasserted individually,including custom data round-tripping on both the poll and an option.
poll.deletedships a lean pollwith the nested vote user omitted, which exercised the generated model against an absent
user.Summary by CodeRabbit
Bug Fixes
Tests