-
-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accept any string as a key for m.direct
account data
#1946
Conversation
Putting the email in the But the email address is the only user ID, the client has when a new DM is created by inviting someone by email. So email address is currently supported in See for example in Element-Web: https://github.com/element-hq/matrix-react-sdk/blob/develop/src/createRoom.ts#L325 |
m.direct
account data
Note: This PR is aligned with the following Element-Web implementation: https://github.com/element-hq/element-web/blob/2f8e98242c6de16cbfb6ebb6bc29cfe404b343cb/src/utils/dm/filterValidMDirect.ts#L35 (where the |
So what you are saying is that the 3pid addresses in |
I don't like the idea of throwing away entries during deserialization. I think we should have an opaque struct that can represent any string, but allows easy access of it as a This would mean a breaking change of course (just like this PR). It's pretty unfortunate that this is coming up (again) just after we did a release, but such is life I guess 🤷🏼 |
a1245bb
to
0adfa1c
Compare
Following the discussion here, I've rework the approach to use existing It looks a lot bigger but a lot of the changes are moving I still have to write some logic to properly validate email and phone number (cf TODOs), but I am interested if you prefer this approach or the one you suggested, that looks fine for me too. |
fec3590
to
144ecc5
Compare
As you can see in the (de)serialization tests for W.r.t. which solution to go with, that's @zecakeh's call. |
Yes I've seen that, but we basically want to represent the same thing (either a MXID or a 3PID), so I thought it would be nice to use the structure and customize the parsing. |
m.direct
account datam.direct
as an user identifier and not strictly an MXID
From the Ruma room, to keep a trace of it here:
|
m.direct
as an user identifier and not strictly an MXIDm.direct
account data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this has already gone through a lot of review rounds but.. A changelog entry would be nice 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for this!
This is the follow up of this [Ruma PR](ruma/ruma#1946) for the SDK. --------- Signed-off-by: Mathieu Velten <[email protected]> Co-authored-by: Benjamin Bouvier <[email protected]>
This is because a lot of
m.direct
in the wild have non valid data, and an email or phone number can end up as a key here when doing 3pid invites.Current behavior is that
m.direct
parsing fully failed in this case, so there is no DMs anymore.You can trigger that easily by trying to invite an email with no MXID bound to it with Element Web.