Skip to content

check_event_allowed callback from the module API cause a TypeError #18101

@c-cal

Description

@c-cal

Description

ThirdPartyEventRulesModuleApiCallbacks.check_event_allowed() freezes incoming events for safety purpose, but the Rust implementation of PushRuleEvaluator doesn't seem to handle immutabledict.

Steps to reproduce

  1. extend the server config with
    default_power_level_content_override:
      public_chat:
        notifications:
          room: 0
  2. register a module which register a check_event_allowed callback. The callback could do nothing, eg: return (True, None)
  3. try to create a public room to see the bug

Homeserver

a local homeserver

Synapse Version

v1.122.0

Installation Method

Docker (matrixdotorg/synapse)

Database

PostgreSQL 15

Workers

Single process

Platform

Ubuntu 24.04

Configuration

No response

Relevant log output

File "/usr/local/lib/python3.12/site-packages/synapse/push/bulk_push_rule_evaluator.py", line 429, in _action_for_event_by_user
     evaluator = PushRuleEvaluator(
                 ^^^^^^^^^^^^^^^^^^
 TypeError: argument 'notification_power_levels': 'immutabledict' object cannot be converted to 'PyDict'

Anything else that would be useful to know?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions