Merged
Conversation
pvizeli
reviewed
Sep 11, 2018
homeassistant/core.py
Outdated
| """ | ||
| context = context or Context() | ||
| self._call_id += 1 | ||
| call_id = self._call_id |
Member
There was a problem hiding this comment.
We should use uuid4. Because we can restore the context object and the caller ID is not equal anymore.
Member
Author
There was a problem hiding this comment.
the call ID is not part of the context, it's only used by the service registry during run time?
balloob
added a commit
that referenced
this pull request
Sep 11, 2018
* Fix invalid state * Make slightly more efficient in unsubscribing * Use uuid4"
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description:
In #15674 we started checking if a service was done by comparing context. This was an incorrect assumption as context has to propagate. So when we added that in #16415, the service executed handler could be called twice.
This fixes it by restoring unique call IDs for service calls.
Related issue (if applicable): fixes #16544
Checklist:
tox. Your PR cannot be merged unless tests passIf the code does not interact with devices: