Move app settings, users and polls to the v2 endpoints by gpunto · Pull Request #6821 · GetStream/stream-chat-android · GitHub
Skip to content

Move app settings, users and polls to the v2 endpoints - #6821

Merged
gpunto merged 7 commits into
developfrom
migrate/v2-lane-1-config-users-polls
Oct 15, 2026
Merged

gpunto merged 7 commits into
developfrom
migrate/v2-lane-1-config-users-polls

Conversation

@gpunto

@gpunto gpunto commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Goal

First step of moving the REST calls to the v2 endpoints: app settings, roles, devices, push preferences, OG, users, blocks, live locations, guest, polls, poll votes and user groups. The websocket stays on v1.

Part of AND-1637

Implementation

  • buildV2RetrofitApi builds these APIs on /api/v2/... paths with the generated Serializer for bodies. Errors keep the v1 envelope, so interceptors and the call adapter are unchanged.
  • Poll votes move under /api/v2/chat/messages/....
  • v2 sends some declared user fields only as typed fields that v1 also kept in custom. withDeclared adds them back to extraData, so both lanes map to the same User.
  • A user's push devices can be stored in their custom data under devices. v1 responses hide that copy; v2 returns it. The user mappers now drop it from extraData, and it is no longer sent in the user upsert or the connect user_details.

Testing

  • V2LaneBatchOneTest, V2LaneBatchTwoTest and V2LaneBatchThreeTest parse v2 responses and serialize v2 requests for every moved endpoint.
  • DomainMappingTest, DtoMappingTest and SocketFactoryTest cover the devices copy on reads, the upsert and connect.
  • Device probes of the moved endpoints on the compose sample, checking the wire payloads and the mapped results.
  • Device probe of the devices handling: a user seeded with a stored devices copy (returned by v2) maps without it, updateUser and connectUser with a devices key in extraData send other custom keys but not devices, and nothing is stored under it.

Summary by CodeRabbit

  • Compatibility
    • Updated app settings, devices, guests, roles, polls, push preferences, user groups, users, and link-preview requests to use the v2 API.
  • Bug Fixes
    • Prevented device data from appearing as duplicate user custom data in responses, requests, and socket connections.
    • Preserved selected user fields in custom data when they are not already present, including deletion and ban details.

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

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 6.21 MB 6.21 MB 0.00 MB 🟢
stream-chat-android-ui-components 11.52 MB 11.52 MB 0.00 MB 🟢
stream-chat-android-compose 13.19 MB 13.20 MB 0.00 MB 🟢
stream-chat-android-ai-compose 2.04 MB 2.04 MB 0.00 MB 🟢
stream-chat-android-ai-ondevice 1.67 MB 1.67 MB 0.00 MB 🟢

@gpunto
gpunto marked this pull request as ready for review October 14, 2026 07:31
@gpunto
gpunto requested a review from a team as a code owner October 14, 2026 07:31
@coderabbitai

coderabbitai Bot commented Oct 14, 2026

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1e848c5a-f7ac-451c-a703-f597bfd347c8
📥 Commits

Reviewing files that changed from the base of the PR and between a445081 and 5ce845c.

📒 Files selected for processing: 19
  • stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/endpoint/ConfigApi.kt
  • stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/endpoint/DeviceApi.kt
  • stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/endpoint/GuestApi.kt
  • stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/endpoint/OpenGraphApi.kt
  • stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/endpoint/PollsApi.kt
  • stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/endpoint/PushPreferencesApi.kt
  • stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/endpoint/RoleApi.kt
  • stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/endpoint/UserApi.kt
  • stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/endpoint/UserGroupApi.kt
  • stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/mapping/DomainMapping.kt
  • stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/mapping/DtoMapping.kt
  • stream-chat-android-client/src/main/java/io/getstream/chat/android/client/di/ChatModule.kt
  • stream-chat-android-client/src/main/java/io/getstream/chat/android/client/socket/SocketFactory.kt
  • stream-chat-android-client/src/test/java/io/getstream/chat/android/client/api2/mapping/DomainMappingTest.kt
  • stream-chat-android-client/src/test/java/io/getstream/chat/android/client/api2/mapping/DtoMappingTest.kt
  • stream-chat-android-client/src/test/java/io/getstream/chat/android/client/socket/SocketFactoryTest.kt
  • stream-chat-android-client/src/test/java/io/getstream/chat/android/network/infrastructure/V2LaneBatchOneTest.kt
  • stream-chat-android-client/src/test/java/io/getstream/chat/android/network/infrastructure/V2LaneBatchThreeTest.kt
  • stream-chat-android-client/src/test/java/io/getstream/chat/android/network/infrastructure/V2LaneBatchTwoTest.kt

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

📝 Walkthrough

Selected API endpoints now use v2 paths and a v2 Retrofit configuration. User mappings exclude device data from custom extra data and restore selected declared fields when eligible. Request and socket user details also filter device data. Tests cover v2 response parsing, request serialization, and user data mapping.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 5ce84

The migrated requests use the intended v2 body serialization, and no outstanding issue has been established that would prevent merging after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 20.41% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 98 functions across 19 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description check Passed The description includes the required Goal, Implementation, and Testing sections. It clearly explains the endpoint migration, mapping changes, and test coverage. The Checklist section is missing, but …
Title check Passed The title clearly describes a significant part of the change by naming the migration of app settings, users, and polls to v2 endpoints. It does not mention all migrated APIs, but it remains concise an…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

A rabbit checks the routes at night
V2 paths now point just right
Device data hops from custom’s store
Declared fields return once more
Tests greet each mapping, clear and bright
Then bunny bounds beyond the byte

Comment @coderabbitai help to get the list of available commands.

@gpunto
gpunto enabled auto-merge October 14, 2026 09:24

@andremion andremion left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question on the devices handling and a small cleanup nit.

@sonarqubecloud

Copy link
Copy Markdown

@andremion andremion left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the follow-ups.

@gpunto
gpunto added this pull request to the merge queue Oct 15, 2026
Merged via the queue into develop with commit 75eb711 Oct 15, 2026
19 checks passed
@gpunto
gpunto deleted the migrate/v2-lane-1-config-users-polls branch October 15, 2026 08:28
@stream-public-bot stream-public-bot added the released Included in a release label Oct 16, 2026
@stream-public-bot

Copy link
Copy Markdown
Contributor

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

Labels

pr:internal Internal changes / housekeeping released Included in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants