-
-
Notifications
You must be signed in to change notification settings - Fork 31.3k
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
Shield service call from cancellation on REST API connection loss #102657
Shield service call from cancellation on REST API connection loss #102657
Conversation
Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
d77a1ef
to
edf425f
Compare
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.
please see #102657 (comment)
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
The breaking change label should probably be added manually to the PR |
close/reopen to restart ci |
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.
Thanks!
Thanks @Shulyaka @MartinHjelmare |
Thanks for the review! |
Breaking change
When calling a service from REST API, the service used to be cancelled on connection drop. If you relied on that behavior, you would need to revisit the logic. With this change, a connection drop will not cancel the service call. Additionally, if the service call takes more than 10 second to execute, the REST API will return and the service call will continue executing in the background. Although this behavior is documented, it was not the case for several past releases.
Proposed change
This PR restores the behavior in the REST API documentation: when a service call is executed via
/api/services/<domain>/<service>
, the call should return when the service has been executed or after 10 seconds, whichever comes first.Also, this PR fixes the cancellation of the service call on disconnect.
Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: