Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Replying to the same thread root multiple times throws error #14624

Closed
@MadLittleMods

Description

@MadLittleMods

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:

  1. Two people send an event at the same time and the whoever races to finish first will be the one sent
  2. Your message fails to send, someone else sends a message in the mean-time and then when you retry, it fails
  3. 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.
  4. 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

  1. Create a message that will act as our thread root
  2. Send a threaded reply where ['m.relates_to']['event_id'] = thread_root
  3. 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:

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/A

Anything else that would be useful to know?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions