Status: accepted
The Poll widget is often used in environments where the rooms are setup by an automation solution (for example “Meetings widget”). These automations are driven by bot users that have at least the moderation role (power level ≥ 50) in the room. This property qualifies this bot user to be a voter and thus can skew the results with “invalid” votes (considering bots don't actually vote). This only affects non-group polls (see also ADR002) because we assume that no-one would add a bot to a group.
We want to ignore bot users in all result views (tables, graphs, PDF).
We will add a REACT_APP_IGNORE_USER_IDS
environment variable that includes a list of user IDs that should be ignored by the poll widget.
We will use ,
as delimiter for multiple user ids since it is no valid character for user identifiers (see User Identifiers and Server Name).
REACT_APP_IGNORE_USER_IDS: '@bot1:matrix.org,@bot2:matrix.org'
New Vector suggested that bots should prefer to use a username that starts with a _
(example: @_bot:matrix.org
).
However, the specification requires that [i]dentifiers must start with one of the characters [a-z], [...]
(Common Namespaced Identifier Grammar).
Thus, it is not possible to create those users via the original Synapse API.
Only very few of the observed bots use this pattern, so it is not stable enough to rely on it.
We also don't know if future user cases might require bots to be actually able to vote.
We could store a list of ignored user ids in the net.nordeck.poll.settings
event so an administrator could add additional bots if needed.
This would also require a UI.
The meetings bot could add itself to this list on meeting creation.
This was discarded because we don't want to create a further dependency between the different widgets.
Using environment variables means that the deployment configuration of the poll widget server container specifies which bot is ignored. Thus the widget users/administrator will not be able to ignore additional users.
Having environment configurations skew the results of the poll widget might add problems because it affects all future and past poll rooms which might break their integrity.
We will ignore all m.room.member
events if the state_key
is part of REACT_APP_IGNORE_USER_IDS
.
All features that rely on the cached room list will thus don't consider the user:
- The number of “voters” when no groups exist.
- The calculation of “invalid” votes when no groups exist.
- The PDF report for polls without groups.
- The group member selection dialog.
It was not intended to stop being able to add ignored users to groups, however, it is easier to ignore the user globally instead of only selectively. Thus, the user is also ignored in that view, i.e., it won't be possible to add a bot to a group anymore.
There are some limitations:
- If an ignored user did vote, the vote will still be displayed (according to ADR002 (No Groups Mode)).
- If the bot is displayed anywhere in the UI, only the user-id will be displayed since the display name is not part of the redux state.
This is the same behavior as for
kick
ed,ban
ed, orleave
d users.