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

m.direct not updated on the room creator's account when starting a private chat #4173

Closed
Tracked by #3506
turt2live opened this issue Nov 11, 2018 · 5 comments
Closed
Tracked by #3506
Labels
A-Spec-Compliance places where synapse does not conform to the spec good first issue Good for newcomers S-Minor Blocks non-critical functionality, workarounds exist. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.

Comments

@turt2live
Copy link
Member

As per https://matrix.org/docs/spec/client_server/r0.4.0.html#direct-messaging the server should be automatically updating the m.direct account data for the creator's account when is_direct: true is supplied. Currently, clients have to manually update the account data (Riot does this).

This was referenced Nov 11, 2018
@neilisfragile neilisfragile added z-p2 (Deprecated Label) A-Spec-Compliance places where synapse does not conform to the spec labels Nov 12, 2018
@reech
Copy link

reech commented Dec 11, 2020

We create 1:1 rooms programmatically with a bot(application service) between userA and userB:

  • Create the room
  • Get AccountData for userA
  • Update AccountData for userA
  • Get AccountData for userB
  • Update AccountData for userB

5 network requests, which could've been done in 1 since all information is available in the first request.
Also, the first request strongly suggest it should be done this way : is_direct.

@ShadowJonathan
Copy link
Contributor

I'm pretty sure there's a way to instantly update account data from a room creation handler. 😉

@clokep clokep added T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. S-Minor Blocks non-critical functionality, workarounds exist. and removed z-p2 (Deprecated Label) labels Feb 24, 2021
@reech
Copy link

reech commented Mar 3, 2021

Yes, excactly that's what we do, but back to the issue:

the server should be automatically updating the m.direct account data for the creator's account when is_direct: true is supplied

If we should create our own handlers then the documentation should be changed also to include all the other stuff you must do, because this won't help you:

To start a direct chat with another user, the inviting user's client should set the is_direct flag to /createRoom

@clokep
Copy link
Member

clokep commented Mar 3, 2021

Looks like we have some special handling for is_direct, but don't have this particular bit, see:

is_direct = config.get("is_direct", None)
if is_direct:
content["is_direct"] = is_direct

Somewhere in that method we need to call the appropriate method in https://github.com/matrix-org/synapse/blob/0a00b7ff14890987f09112a2ae696c61001e6cf1/synapse/handlers/account_data.py

We'll also want to make sure we add a test for this. (Probably a sytest?)

@clokep clokep added the good first issue Good for newcomers label Mar 3, 2021
@turt2live
Copy link
Member Author

This is an invalid issue: the spec says no such words, and 2018 Travis probably confused is_direct and m.direct.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Spec-Compliance places where synapse does not conform to the spec good first issue Good for newcomers S-Minor Blocks non-critical functionality, workarounds exist. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
Projects
None yet
Development

No branches or pull requests

5 participants