element-hq / element-hq/synapse

Don't accept threaded receipts for reactions to/replies to/edits of a thread root

Aperta
#5 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
A-Threads
Lingua principale
Python
Stelle
4.6k
Fork
600
Merge medio
5g 6h
PR unite (30g)
46

Descrizione

### Description

Previously, the spec implied that threaded receipts were acceptable when referring to thread roots, or reactions to them etc. but this was a spec bug, which is fixed in https://github.com/matrix-org/matrix-spec/pull/1677 . See https://github.com/matrix-org/matrix-spec-proposals/pull/4037 for more detail.

Synapse's code at https://github.com/element-hq/synapse/blob/930dc9e2d3efd6d82b86c2205b80d6ccb9b4bb86/synapse/rest/client/receipts.py#L124-L162 reflects the spec bug, accepting incorrect receipts. It should not accept threaded receipts for events that are not in the thread.

### Steps to reproduce

- Create some messages in a room, including a thread
- Create a reaction to the thread root
- Send a threaded receipt for the reaction, that gives the `thread_id` as the ID of the thread root event, implying that the reaction is in the thread
- Note that Synapse accepts this receipt

Synapse should reject this receipt since a reaction to a thread root is not in the thread.

### Homeserver

matrix.org

### Synapse Version

1.98.0rc1 (b=matrix-org-hotfixes,c2deef254a)

### Installation Method

I don't know

### Database

-

### Workers

Multiple workers

### Platform

-

### Configuration

-

### Relevant log output

```shell
-
```

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

-

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.