Skip to content

Add coordinator v2 adapters bridging to stream-android-core#1737

Draft
aleksandar-apostolov wants to merge 2 commits into
develop-v2from
gsd/phase-2-01-adapters
Draft

Add coordinator v2 adapters bridging to stream-android-core#1737
aleksandar-apostolov wants to merge 2 commits into
develop-v2from
gsd/phase-2-01-adapters

Conversation

@aleksandar-apostolov

@aleksandar-apostolov aleksandar-apostolov commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Goal

Closes AND-1281

First step of the coordinator socket migration to stream-android-core's StreamClient. This PR only adds the bridging code — the actual swap happens in follow-up PRs. Nothing changes at runtime after this merges; the adapters aren't wired in yet.

Merge order: this PR → wire StreamClient into StreamVideoClient (#1738) → rewrite ConnectionState (#1739).

Implementation

Four new internal adapter classes under stream-video-android-core/socket/coordinator/v2/:

File Purpose
VideoEventSerialization.kt Reuses our existing MoshiVideoParser to plug video events into core's event pipeline
IntegrationStreamTokenProvider.kt Wraps the integration's TokenProvider so core can consume it
GuestStreamTokenProvider.kt Handles guest-user auth by calling the existing createGuest REST endpoint on first token load
ConnectionStateMapper.kt Placeholder — the final StreamConnectionState → ConnectionState mapping lands in a follow-up PR

All four classes are internal. No public API changes.

Also includes four unit tests for the adapters. They fail until the wiring PR lands — that's intentional, they pin the expected behavior contracts.

Guest auth simplification: the existing WritableUserRepository interface is defined inline in GuestStreamTokenProvider for now. A follow-up PR swaps it for the concrete UserRepository once that becomes available on develop-v2.

Testing

  • Full project compiles cleanly.
  • stream-video-android-core:testDebugUnitTest passes.
  • BCV apiCheck shows zero public API diff — the new classes are all internal.
  • spotlessCheck green.

- VideoEventSerialization wraps MoshiVideoParser as StreamEventSerialization<VideoEvent>
- IntegrationStreamTokenProvider adapts video TokenProvider to core StreamTokenProvider
- GuestStreamTokenProvider mints a guest JWT via createGuest and adopts server identity
- ConnectionStateMapper publishes StreamConnectionState -> ConnectionState extension
  (placeholder mapping — a later plan reshapes ConnectionState to mirror core 1:1)
- VideoEventSerializationTest round-trips four VideoEvent subclasses through
  MoshiVideoParser plus a malformed-input negative case
- IntegrationStreamTokenProviderTest asserts delegation and userId being ignored
- GuestStreamTokenProviderTest verifies createGuest single-call and user adoption
- ClientStateConnectionMappingTest is table-driven over StreamConnectionState
  variants; each expected value carries a TODO(02-03) handoff marker
@aleksandar-apostolov aleksandar-apostolov added the pr:new-feature Adds new functionality label Jul 1, 2026
@github-actions

github-actions Bot commented Jul 1, 2026

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

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

SDK Size Comparison 📏

SDK Before After Difference Status
stream-video-android-core 12.05 MB 12.35 MB 0.30 MB 🟡
stream-video-android-ui-xml 5.68 MB 5.73 MB 0.05 MB 🟢
stream-video-android-ui-compose 6.28 MB 5.86 MB -0.43 MB 🚀

@sonarqubecloud

sonarqubecloud Bot commented Jul 1, 2026

Copy link
Copy Markdown

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

Labels

pr:new-feature Adds new functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant