Skip to content
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

Fixes subscription to _deviceConnector.deviceConnectionStateUpdateStr… #2

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

picofaradpjf
Copy link
Collaborator

…eam leaking (PhilipsHue#876)

  • Previous code would create a broadcastStream from a normal stream (created by Repeater). When this is done, the source stream subscription needs to be explicitly closed. This is usually done by implementing the onCancel callback from the asBroadcastStream method. This was not happening, so every call to connectedDeviceStream was creating a new subscription that was never closed.
  • To fix the problem, this commit uses the Repeater.broadcast constructor which already returns a broadcast stream and also closes the source stream subscription when needed

…eam leaking (#876)

- Previous code would create a broadcastStream from a normal stream (created by Repeater).
When this is done, the source stream subscription needs to be explicitly closed.
This is usually done by implementing the onCancel callback from the asBroadcastStream method.
This was not happening, so every call to connectedDeviceStream was creating a new subscription that was never closed.
- To fix the problem, this commit uses the Repeater.broadcast constructor which already returns a broadcast stream
and also closes the source stream subscription when needed
@picofaradpjf picofaradpjf merged commit 343dfef into GreenestGrow:master Nov 25, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants