This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
event_match push rule condition doesn't work on booleans or integers #13465
Labels
A-Push
Issues related to push/notifications
O-Occasional
Affects or can be seen by some users regularly or most users rarely
S-Minor
Blocks non-critical functionality, workarounds exist.
T-Enhancement
New features, changes in functionality, improvements in performance, or user-facing enhancements.
Z-Spec-Blocked
This change is blocked on specification (e.g. an MSC).
Description
The
event_match
condition is evaluated against a flattened variant of the event dictionary that drops all non-string values (see https://github.com/matrix-org/synapse/blob/develop/synapse/push/push_rule_evaluator.py#L345). As a result, it's not possible to match against any boolean or integer JSON values.As an example, live location sharing uses events of type
beacon_info
with a"live": true/false
value incontent
to signal whether location sharing was started or ended.Since the value of
live
is boolean, it's not currently possible to define a push rule that only matches"live": true
but not"live": false
.The spec doesn't explicitly state that
event_match
should only work on strings. It just says the pattern is evaluated against "a field" on the event.Therefore, I think
event_match
should work on the string-representation of boolean and integer values as well.Steps to reproduce
Define a push rule that matches on a boolean value, e.g.
Notice how it's not having any effect.
Homeserver
n/a
Synapse Version
Current develop
Installation Method
No response
Platform
n/a
Relevant log output
n/a
Anything else that would be useful to know?
n/a
The text was updated successfully, but these errors were encountered: