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

Multiple triggering of a scene reactions due to the trigger's fault state #77

Open
mabakay opened this issue Nov 13, 2023 · 0 comments
Open

Comments

@mabakay
Copy link

mabakay commented Nov 13, 2023

Summary:
When utilizing multiple channels in a scene trigger and updates from these channels occur simultaneously, both queries will commence processing. In such cases, the same scene record is retrieved from the database, containing an identical logical trigger state in the 'lastTriggerState' field. If a change in the value of any of these channels would result in a modification of the scene trigger state, the order of service at this point becomes inconsequential. The first processed query will store the new state in the database with the updated logical state of the scene trigger. However, at this moment the other channels still retain the previous state in memory, leading them to also trigger reactions assigned to the scene. This in turn may result in multiple notifications, for example.

Suggested action:
Use a critical section or another revalidation mechanism before accessing scene data.

Code reference:
https://github.com/fracz/supla-scripts/blob/master/backend/controllers/StateWebhookController.php#L64

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

No branches or pull requests

1 participant