element-hq / element-hq/synapse

Rescinding or declining a room join request over federation is not implemented

Open
#18,030 1 comment 0 reactions 0 assignees View on GitHub
A-Knock O-Uncommon S-Minor T-Enhancement
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

### Description

While working on the room knocking feature in a client I realised I wasn't receiving any feedback after either cancelling a knock request or declining it over federation, only accepting one (sending an invite) seemed to work.

After taking a look at Synapse's code I found: https://github.com/element-hq/synapse/blob/eedab12e6d794420b3b16e38cb4314dab6a9034c/synapse/handlers/room_member.py#L2022-L2025

This mentions only rescinding (aka cancelling) knocks over federation, but [the code that calls this function](https://github.com/element-hq/synapse/blob/eedab12e6d794420b3b16e38cb4314dab6a9034c/synapse/handlers/room_member.py#L1149) will be triggered when `effective_membership_state == Membership.LEAVE` and this will also happen when kicking a knock member (declining an invite).

I did some tests with `element.io` and `matrix.org` members in a room with knock join rule and they seemed to confirm my suspicions: neither cancelling a knock request nor declining it seems to work over federation.

Maybe this needs https://github.com/matrix-org/matrix-spec-proposals/pull/4233 ?

### Steps to reproduce

- Create a room with knock join rule in a homeserver (HS1).
- Request to join the room with an user in another homeserver (HS2).
- As the user in HS2, cancel the request to join. The user in HS1 will still see the knock membership after reloading the room members.
- Now decline the knock request in HS1. The user in HS2 won't receive any membership updates in the `/sync` methods and will still think his knock request is pending.

### Homeserver

matrix.org, element.io

### Synapse Version

1.120.2

### Installation Method

I don't know

### Database

Not sure they're not my HS

### Workers

I don't know

### Platform

Not sure.

### Configuration

_No response_

### Relevant log output

```shell
AFAICT there was no relevant log output, as no action is done.
```

### Anything else that would be useful to know?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.