Skip to content

Migrate poll write request bodies to generated models - #6607

Draft
gpunto wants to merge 2 commits into
developfrom
migrate/poll-write-requests
Draft

Migrate poll write request bodies to generated models#6607
gpunto wants to merge 2 commits into
developfrom
migrate/poll-write-requests

Conversation

@gpunto

@gpunto gpunto commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Goal

Migrate the poll write request bodies (createPoll, updatePoll, createPollOption, updatePollOption) to the generated CreatePollRequest, UpdatePollRequest, CreatePollOptionRequest, UpdatePollOptionRequest, PollOptionInput, and PollOptionRequest network models. Unblocked by the CHA-4436 backend fix that tags the poll request custom field.

Part of AND-1291

Implementation

  • Add the 6 generated internal poll write-request models; remove the hand-written CreatePollRequest/UpdatePollRequest/UpstreamOptionDto.
  • Each model carries custom (extraData) flattened to the JSON root via a CustomObjectDtoAdapter(extraDataPropertyName = "custom") registered in MoshiChatParser; votingVisibility uses the generated sealed class + its adapter.
  • MoshiChatApi mappers and PollsApi @Body types retyped to the generated models.

Testing

  • Serialization tests (CreatePollRequestAdapterTest, PollOptionInputAdapterTest, PollWriteRequestAdapterTest) lock the flattened wire shape for all 6 models; MoshiChatApiTest covers the mappers.
  • spotlessApply, apiDump (no public-API change), detekt, and the full client testDebugUnitTest suite pass.
  • Device probe against the real backend: createPoll/updatePoll/createPollOption/updatePollOption each send custom flattened at root and voting_visibility (both anonymous and public); all return 201 and echo the custom sentinel back.

@gpunto gpunto added the pr:internal Internal changes / housekeeping label Jul 31, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR checklist ✅

All required conditions are satisfied:

  • Title length is OK (or ignored by label).
  • At least one pr: label exists.
  • Sections ### Goal, ### Implementation, and ### Testing are filled, or the PR is bot-authored.
  • An issue is linked (Linear ticket or GitHub issue), or the PR is bot-authored.

🎉 Great job! This PR is ready for review.

@github-actions

Copy link
Copy Markdown
Contributor

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 5.96 MB 5.95 MB -0.02 MB 🚀
stream-chat-android-ui-components 11.22 MB 11.24 MB 0.02 MB 🟢
stream-chat-android-compose 12.71 MB 12.72 MB 0.00 MB 🟢

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
63.1% Coverage on New Code (required ≥ 80%)
8.5% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:internal Internal changes / housekeeping

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant