Skip to content

Ensure events are not sent to the initiator client#215

Merged
ikalchev merged 1 commit intoikalchev:devfrom
bdraco:avoid_send_events_to_sender_client_addr
Jan 26, 2020
Merged

Ensure events are not sent to the initiator client#215
ikalchev merged 1 commit intoikalchev:devfrom
bdraco:avoid_send_events_to_sender_client_addr

Conversation

@bdraco
Copy link
Copy Markdown
Contributor

@bdraco bdraco commented Dec 4, 2019

Clients that made the characteristic change are NOT supposed to get
events
about the characteristic change as it can cause an unexpected HTTP
disconnect (connection
reset by peer) which leads temporary unresponsive accessories and
violates the HAP spec

@codecov-io
Copy link
Copy Markdown

codecov-io commented Dec 4, 2019

Codecov Report

Merging #215 into dev will increase coverage by 0.59%.
The diff coverage is 86.66%.

@@            Coverage Diff             @@
##              dev     #215      +/-   ##
==========================================
+ Coverage   60.97%   61.57%   +0.59%     
==========================================
  Files          16       16              
  Lines        1694     1697       +3     
  Branches      175      176       +1     
==========================================
+ Hits         1033     1045      +12     
+ Misses        622      612      -10     
- Partials       39       40       +1
Impacted Files Coverage Δ
pyhap/accessory.py 53.37% <100%> (ø) ⬆️
pyhap/characteristic.py 98.21% <100%> (ø) ⬆️
pyhap/accessory_driver.py 62.14% <75%> (+3.65%) ⬆️

@bdraco bdraco force-pushed the avoid_send_events_to_sender_client_addr branch from 5d3d46d to ad6c488 Compare December 9, 2019 10:40
Clients that made the characteristic change are NOT supposed to get
events
about the characteristic change as it can cause an unexpected HTTP
disconnect (connection
reset by peer) which leads temporary unresponsive accessories and
violates the HAP spec
@ikalchev
Copy link
Copy Markdown
Owner

@bdraco You said that the fix in #197 likely fixes this one as well. Is this then still needed? Or are the changes here needed to make pyhap HAP-spec compliant?

@bdraco
Copy link
Copy Markdown
Contributor Author

bdraco commented Jan 26, 2020

@ikalchev The changes are still needed to make it compliant and avoid the disconnect when a message is sent when the client is not expecting one.

@bdraco
Copy link
Copy Markdown
Contributor Author

bdraco commented Jan 26, 2020

The easiest way I found to replicate the disconnect is to rapidly turn a light on/off that is linked to home assistant as it will cause the event message to be sent to the server from the client while the client is writing.

@ikalchev ikalchev merged commit 4bb331f into ikalchev:dev Jan 26, 2020
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.

3 participants