-
-
Notifications
You must be signed in to change notification settings - Fork 143
feat(realtime): add heartbeat callback #709
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(realtime): add heartbeat callback #709
Conversation
e927454
to
2ab61f6
Compare
Pull Request Test Coverage Report for Build 14715004040Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for heartbeat callbacks to the realtime client and includes corresponding tests. Key changes include the introduction of a new HeartbeatStatus enum, modifications to the heartbeat sending and handling logic in RealtimeClientV2, and updates to test cases to verify heartbeat behavior.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
Tests/RealtimeTests/RealtimeTests.swift | Added new tests for heartbeat responses and timeout behavior. |
Sources/Realtime/Types.swift | Introduced the HeartbeatStatus enum to represent heartbeat events. |
Sources/Realtime/RealtimeClientV2.swift | Updated heartbeat logic, channel storage (from array to dictionary), and associated reconnection handling. |
Comments suppressed due to low confidence (1)
Sources/Realtime/RealtimeClientV2.swift:505
- [nitpick] The previous implementation returned all channels with the matching topic using a filter. Please confirm that restricting to a single channel (via the dictionary lookup) is intended, ensuring that multiple channels per topic are not expected.
return $0.channels[message.topic]
Co-authored-by: Copilot <[email protected]>
5cd006e
to
cb60535
Compare
What kind of change does this PR introduce?
Bug fix, feature, docs update, ...
What is the current behavior?
Please link any relevant issues here.
What is the new behavior?
Feel free to include screenshots if it includes visual changes.
Additional context
Add any other context or screenshots.