Skip to content

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

@mabakay

Description

@mabakay

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions