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

Autoinvite not working with federations #18

Closed
dzondrak opened this issue Sep 21, 2023 · 1 comment
Closed

Autoinvite not working with federations #18

dzondrak opened this issue Sep 21, 2023 · 1 comment

Comments

@dzondrak
Copy link

dzondrak commented Sep 21, 2023

Hello, I experienced an issue when I was trying to test autonvite with two federations, there is a problem when the room is in a partial state but host is't stored in partial_state_rooms_servers for this room, which ends "Host not in room" error.
Steps to reproduce:

  1. element-web
  2. two federations with autoinvite enabled, with no workers enabled
  3. on 1 federation, invite user from 2 federation to 1-1 room
  4. on 2 federation there is an information that user 2 joined the room and an infinite circle progress bar and unable to send any message

I will analyze this further but maybe someone knows something to help me, so that I don't have to reinvent the wheel:)

@sandhose
Copy link
Member

sandhose commented Mar 1, 2024

This looks like it's an issue on the Synapse side, which should be fixed with element-hq/synapse#16973

sandhose added a commit to element-hq/synapse that referenced this issue Mar 6, 2024
…#16973)

Since Synapse 1.76.0, any module which registers a `on_new_event`
callback would brick the ability to join remote rooms.
This is because this callback tried to get the full state of the room,
which would end up in a deadlock.

Related:
matrix-org/synapse-auto-accept-invite#18

The following module would brick the ability to join remote rooms:

```python
from typing import Any, Dict, Literal, Union
import logging

from synapse.module_api import ModuleApi, EventBase

logger = logging.getLogger(__name__)

class MyModule:
    def __init__(self, config: None, api: ModuleApi):
        self._api = api
        self._config = config

        self._api.register_third_party_rules_callbacks(
            on_new_event=self.on_new_event,
        )

    async def on_new_event(self, event: EventBase, _state_map: Any) -> None:
        logger.info(f"Received new event: {event}")

    @staticmethod
    def parse_config(_config: Dict[str, Any]) -> None:
        return None
```

This is technically a breaking change, as we are now passing partial
state on the `on_new_event` callback.
However, this callback was broken for federated rooms since 1.76.0, and
local rooms have full state anyway, so it's unlikely that it would
change anything.
@devonh devonh closed this as completed Apr 29, 2024
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

3 participants