-
Notifications
You must be signed in to change notification settings - Fork 260
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
#4228
Conversation
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 don't think losing static typing is an option, instead we should introduce an enum that can be one of all the types we expect (owned user id OR email address, if I understand correctly).
Also, BaseRoomInfo
is serialized in the database, so we'd need a test making sure that we don't need a migration there, when the previous content was serialized as a OwneduserId
; if the test fails, we need a migration.
m.direct
account data
Fine for me, but it also needs to support phone numbers I think, basically any identifier types. Fine for you ? |
Beware that it will not solve the trouble for some legacy buggy behavior of Element Web. |
Fine if we do have some type checking / upfront validation for all these other id types indeed :) |
Is there a way to not fully failed The entry should just be omitted in this case I believe. Should I keep implementing |
So I think the question is, will serde uses If not, what would be suited to do to still deserialize |
If introducing ENUMS can we have an "UNKNOWN" too please which could catch either nonsense, such as "[object Object]": or other id's that this SDK perhaps does not know about (yet)? |
Yes I think I have a way with something like that @spaetz , thanks. |
cd0e760
to
2022ae9
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4228 +/- ##
==========================================
+ Coverage 85.15% 85.17% +0.02%
==========================================
Files 280 280
Lines 30858 30861 +3
==========================================
+ Hits 26278 26287 +9
+ Misses 4580 4574 -6 ☔ View full report in Codecov by Sentry. |
bdff7aa
to
a624790
Compare
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.
Does OwnedDirectUserIdentifier deserialize cleanly from an OwnedUserId? Otherwise this needs a migration, since we're storing the BaseRoomInfo in db
GOOD NEWS, EVERYONE! Since both are encoded as strings, and use the |
This feels like something that should be in Ruma, here is the PR. |
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.
lgtm, thanks.
Co-authored-by: Benjamin Bouvier <[email protected]> Signed-off-by: Mathieu Velten <[email protected]>
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 the follow up of this Ruma PR for the SDK.
Ruma PR needs to be merged first.