element-hq / element-android

A Matrix collaboration client for Android.
https://element.io/
GNU Affero General Public License v3.0
3.39k stars 732 forks source link

New DMs not always marked as such #3333

Open 0x1a8510f2 opened 3 years ago

0x1a8510f2 commented 3 years ago

Describe the bug

Sometimes when creating a DM via Element Android, it is not actually marked as a DM, which means it sticks around in the rooms part of the app. I have noticed it this time when pressing the "Direct message" button in a user's room profile.

To Reproduce

Steps to reproduce the behavior:

  1. Go to a user's profile in a room
  2. Click on "Direct message"
  3. Wait for the DM to be created (actually, some feedback here would be nice)
  4. See that what was created is in fact a normal room not a DM

Expected behavior

The room should be marked as a DM in all cases

Smartphone (please complete the following information):

Additional context

Not sure if reproducible 100% of the time but happened to me around 2 times now total (bearing in mind that I don't open a lot of DMs).

Also, if anyone can tell me how to convert said room to a DM, that would be appreciated :D

duncanturk commented 3 years ago

I think there is no GUI-way to convert a room to a DM.

If you have some technical knowledge you can convert a room using curl (or something else):

  1. You can pull your current list of DMs using curl -H"Authorization: Bearer <login_token>" -XGET https://<homeserver_domain>/_matrix/client/r0/user/<url_encoded_matrix_id>/account_data/m.direct > directs. You can find your login_token on element-web/desktop in "all settings"->"help & about"->scroll to bottom. matrix id is you full id, e.g.: @duncanturk:synapse.duncanturk.com -> %40duncanturk%3Asynapse.duncanturk.com.
  2. make a backup of the received file in case something gets screwed up
  3. Add your user-room pair to the list. Room and user ID can be found in element-web/desktop in the room details an room member list
  4. write back your changes using curl -H"Authorization: Bearer <login_token>" -XPUT https://<homeserver_domain>/_matrix/client/r0/user/<url_encoded_matrix_id>/account_data/m.direct -d @directs
0x1a8510f2 commented 3 years ago

@duncanturk

I think there is no GUI-way to convert a room to a DM.

Yeah, I believe there used to be one but got removed :(

As for those steps, I did use cURL as recommended and they worked great. Thanks! :D

panicbit commented 3 years ago

Element Web has a command to convert a room into a DM: /converttodm (there's also /converttoroom for the inverse).

bmarty commented 2 years ago

(Will be handled by #3533)

ShadowJonathan commented 2 years ago

(Will be handled by https://github.com/vector-im/element-android/issues/3533)

Note: that is only a workaround, i think the root problem from this issue is related to one in element-web; https://github.com/vector-im/element-web/issues/12420

It's probably related to syncing the m.direct tag, which has always been flaky for my feeling.

ouchadam commented 2 years ago

interestingly, the time I experienced this, a clear cache didn't help which makes me believe there's a bug in the accumulation of the room type as other clients were seemingly unaffected (haven't been able to reproduce for a while though)