Migrate the socket hello and keep-alive to the generated event models by gpunto · Pull Request #6797 · GetStream/stream-chat-android · GitHub
Skip to content

Migrate the socket hello and keep-alive to the generated event models - #6797

Merged
gpunto merged 2 commits into
developfrom
migrate/socket-hello-mutes-events
Oct 12, 2026
Merged

gpunto merged 2 commits into
developfrom
migrate/socket-hello-mutes-events

Conversation

@gpunto

@gpunto gpunto commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Goal

Parse the socket hello and keep-alive (both health.check) with the generated event models.

Part of AND-1291

Implementation

  • Vendor the generated ConnectedEvent and HealthCheckEvent, and delete ConnectedEventDto and HealthEventDto.
  • A health.check carrying me still maps to ConnectedEvent, and any other health.check to HealthEvent.

Testing

GeneratedSocketEventParsingTest maps the hello and the keep-alive, and rejects either one missing a required field, as well as a hello whose user misses one. The mapping tests cover every field.

On a device: reconnected the socket and checked the hello's connection id, timestamp and current user, and that the client took its connection id. The socket then stayed up on keep-alives for 45 seconds without reconnecting.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of WebSocket connection and health-check events, including their timestamps and connection details.
    • Connection events now retain user and unread-count information from the server, and invalid event data is rejected.

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

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 6.23 MB 6.23 MB 0.00 MB 🟢
stream-chat-android-ui-components 11.53 MB 11.53 MB 0.00 MB 🟢
stream-chat-android-compose 13.20 MB 13.20 MB 0.00 MB 🟢

@gpunto
gpunto force-pushed the migrate/socket-hello-mutes-events branch from d606470 to 7b82516 Compare October 9, 2026 07:32
@gpunto
gpunto force-pushed the migrate/socket-hello-mutes-events branch from 7b82516 to cabf306 Compare October 9, 2026 11:35
@sonarqubecloud

sonarqubecloud Bot commented Oct 9, 2026

Copy link
Copy Markdown

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

coderabbitai Bot commented Oct 12, 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: cefc9772-5af0-4fb1-b42f-fc5d8f997124

📥 Commits

Reviewing files that changed from the base of the PR and between c6600ea and 0a1b871.


📒 Files selected for processing (8)
  • stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/mapping/EventMapping.kt
  • stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/model/dto/EventDtos.kt
  • stream-chat-android-client/src/main/java/io/getstream/chat/android/client/parser2/adapters/EventAdapter.kt
  • stream-chat-android-client/src/main/java/io/getstream/chat/android/network/models/ConnectedEvent.kt
  • stream-chat-android-client/src/main/java/io/getstream/chat/android/network/models/HealthCheckEvent.kt
  • stream-chat-android-client/src/test/java/io/getstream/chat/android/client/api2/MoshiChatApiTestArguments.kt
  • stream-chat-android-client/src/test/java/io/getstream/chat/android/client/api2/mapping/EventMappingTestArguments.kt
  • stream-chat-android-client/src/test/java/io/getstream/chat/android/client/parser2/GeneratedSocketEventParsingTest.kt

💤 Files with no reviewable changes (1)
  • stream-chat-android-client/src/main/java/io/getstream/chat/android/client/api2/model/dto/EventDtos.kt

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



📝 Walkthrough

Walkthrough

Connected and health-check WebSocket events now use generated event models in parsing and domain mapping. The dedicated connected and health event DTO declarations and dispatch branches were removed. New parsing tests check event fields and reject frames that lack required fields. Mapping and API test fixtures now use the generated models.


Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 0a1b8

No confirmed issue prevents merging after normal checks.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 15 functions across 7 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly and concisely describes the primary change: migrating socket hello and keep-alive handling to generated event models.
Description check Passed The description includes the goal, implementation details, issue reference, and relevant unit and device testing. UI sections and checklists are omitted, but they are not critical for this non-UI chan…
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

I’m a rabbit, ears held high,
New socket events hop by.
Connected frames land neat and clear,
Health-check fields appear.
Tests inspect each JSON clue,
Then I nibble carrots too.

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

@gpunto
gpunto added this pull request to the merge queue Oct 12, 2026
Merged via the queue into develop with commit 6ed5eff Oct 12, 2026
20 checks passed
@gpunto
gpunto deleted the migrate/socket-hello-mutes-events branch October 12, 2026 11:26
@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