-
Notifications
You must be signed in to change notification settings - Fork 253
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
base: main
Are you sure you want to change the base?
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. |
d8ed679
to
cd0e760
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4228 +/- ##
==========================================
+ Coverage 84.92% 84.93% +0.01%
==========================================
Files 274 274
Lines 29805 29805
==========================================
+ Hits 25311 25316 +5
+ Misses 4494 4489 -5 ☔ View full report in Codecov by Sentry. |
@@ -45,7 +45,7 @@ once_cell = "1.16.0" | |||
pin-project-lite = "0.2.9" | |||
rand = "0.8.5" | |||
reqwest = { version = "0.12.4", default-features = false } | |||
ruma = { version = "0.11.1", features = [ | |||
ruma = { git = "https://github.com/ruma/ruma.git", rev = "35fda7f2f7811156df2e60b223dbf136fc143bc8", features = [ |
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.
Potentially stating the obvious here, but if you wanna do a crates.io release soon (I think this was planned), make sure to only merge this PR afterwards 😉
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.
New policy in town, no git deps anymore. That's why cargo-deny makes the CI fail.
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.
Oh. Well I don't think we'll have the Ruma change blocking this PR out on crates.io anytime soon.
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.
No rush on my side, it can wait.
Feel free to review in the meantime, so we can merge when we got a ruma release out.
This is the follow up of this Ruma PR for the SDK.
Ruma PR needs to be merged first.