Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This timeout is for the „slow to respond“ message. The problem with snapshot handlers is that they will block the accessory from receiving further request from the device.
Also currently, we do a 5000+17000 max timeout (after which we return a HAPStatue Timeout). If we really are increasing the timeout to 8s we might want to decrease the 17s one?
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.
I opted to leave the one at 17s because it seems reasonable. I understand that they may block the accessory from receiving further requests - that’s the plugin developer’s problem, not Homebridge’s. I don’t want Homebridge telling me what I already know. 😄 In my use case, I know that they may take longer than 5 seconds to complete - that doesn’t make it wrong or invalid and it leads to unnecessary end-user questions. There’s currently no way to turn these off or configure them to more properly be tuned to an individual plugin’s needs. That’s for another day and then the plugin developer can decide how much alerting (or not) they want. That’s the right long-term answer, but in the short-term, I think this is reasonable.
TL;DR: I think 17s is good as it is, with a warning at the ~45% mark (8s) and a timeout at 17s (100% for the purposes of this conversation). A warning at the ~17% mark (5s) is overly aggressive. It’s a reasonable compromise.
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.
Sounds good, thanks for explaining the rationale behind this change 👍