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

When loading /relations, synapse doesn’t seem to take the direction parameter into account #13793

Closed
justjanne opened this issue Sep 13, 2022 · 3 comments
Assignees
Labels
A-Threads Threaded messages T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.

Comments

@justjanne
Copy link

justjanne commented Sep 13, 2022

Description

I’m trying to implement a client-side PoC for an improved way of loading threads, which would use synapse’s MSC3715 implementation.

Steps to reproduce

  • create thread with many events, e.g. 26 events containing each a-z
  • make request to /_matrix/client/unstable/rooms/$roomId/relations/$rootEventId/m.thread?org.matrix.msc3715.dir=f&limit=5 and to
    /_matrix/client/unstable/rooms/$roomId/relations/$rootEventId/m.thread?org.matrix.msc3715.dir=b&limit=5
  • both times the events for z, y, x, w, v are returned

Homeserver

Delight Team’s Threads Dev Server

Synapse Version

1.65.0rc2

Anything else that would be useful to know?

If more information is needed on the environment of the homeserver, please ask @clokep.

@clokep clokep added T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. A-Threads Threaded messages labels Sep 13, 2022
@clokep
Copy link
Member

clokep commented Sep 13, 2022

I was able to reproduce this on the given server, but we weirdly have a test for exactly this that works:

# Request the relations again, but with a different direction.
channel = self.make_request(
"GET",
f"/_matrix/client/v1/rooms/{self.room}/relations"
f"/{self.parent_id}?limit=1&org.matrix.msc3715.dir=f",
access_token=self.user_token,
)
self.assertEqual(200, channel.code, channel.json_body)
# We expect to get back a single pagination result, which is the earliest
# full relation event we sent above.
self.assertEqual(len(channel.json_body["chunk"]), 1, channel.json_body)
self.assert_dict(
{
"event_id": first_annotation_id,
"sender": self.user_id,
"type": "m.reaction",
},
channel.json_body["chunk"][0],
)

Clearly we're missing something, but I'm not sure what. I attempted to modify the unit test to reproduce this by:

  1. Specifying org.matrix.msc3715.dir=f (instead of letting it fallback to that value).
  2. Specifying that we're interested in m.annotation specifically (instead of all relations).

I couldn't think of much else to try, but will need to look deeper into this.

@clokep clokep self-assigned this Sep 13, 2022
@DMRobertson
Copy link
Contributor

@MatMaul will see if he can spend a few hours investigating this---but timebox it or hand back to Patrick if that's not straightfoward.

@clokep
Copy link
Member

clokep commented Sep 19, 2022

We can no longer reproduce this after updating the test server. We're closing this for now, but will reopen if we see an issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Threads Threaded messages T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
Projects
None yet
Development

No branches or pull requests

4 participants