This repository was archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Replying to the same thread root multiple times throws error #14624
Copy link
Copy link
Closed
Labels
A-ThreadsThreaded messagesThreaded messages
Description
Description
Trying to create multiple thread replies against a thread root will throw M_UNKNOWN: Cannot start threads from an event with a relation.
This can happen in a variety of races:
- Two people send an event at the same time and the whoever races to finish first will be the one sent
- Your message fails to send, someone else sends a message in the mean-time and then when you retry, it fails
- One person's server doesn't have the latest event in the thread yet which already replied to the thread
- I haven't tested this to see how it reconciles itself and looks for clients against the local and remote server after the dust settles. I know it won't be rejected over federation at least according to the MSC.
- Personally, I stumbled upon this while implementing threads with the Gitter bridge and didn't want to reference the latest message event in the thread (always reference the thread root).
I don't see this error scenario specifically mentioned in the threads MSC3440.
Steps to reproduce
- Create a message that will act as our thread root
- Send a threaded reply where
['m.relates_to']['event_id'] = thread_root✅ - Send another threaded reply where
['m.relates_to']['event_id'] = thread_root❌ ->M_UNKNOWN: Cannot start threads from an event with a relation
Relevant code:
synapse/synapse/handlers/message.py
Line 1322 in cee9445
| 400, "Cannot start threads from an event with a relation" |
Homeserver
...
Synapse Version
1.72.0
Installation Method
Docker (matrixdotorg/synapse)
Database
SQLite
Workers
Single process
Platform
N/A
Configuration
No response
Relevant log output
N/AAnything else that would be useful to know?
No response
Metadata
Metadata
Assignees
Labels
A-ThreadsThreaded messagesThreaded messages