-
Notifications
You must be signed in to change notification settings - Fork 247
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
Add direct_target
to Room struct
#104
Conversation
Tests failing due to type length limit; I'm not comfortable changing that in a lib (and wouldn't know where to put it anyway). I'd say it was a preexisting problem that would deserve its own PR even if that means delaying this. Reading up on it, it looks like "boxing" things helps split types down? |
I think we can just bump the limits, there are a couple of issues in rustc with this, relevant issue is over here rust-lang/rust#54540. At the bottom mostly, there was a regression as it seems. A new Rust release is scheduled quite soon so we'll be able to remove them once this is fixed. |
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.
Generally looks good, couple of grammar issues.
As I mentioned already all of this will change in the future once we get rid of our snapshot based state store.
matrix_sdk_base/src/client.rs
Outdated
@@ -695,6 +695,25 @@ impl BaseClient { | |||
// } | |||
} | |||
|
|||
/// Handle a m.direc event, updating room states if necessary. |
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.
/// Handle a m.direc event, updating room states if necessary. | |
/// Handle a m.direc event, updating the room states if necessary. |
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.
(This event is not tied to a room but multiple rooms, made rooms plural instead.)
0077ca6
to
d3b4662
Compare
Thank you, fixed the comments in their original commits as a force push (please say for future PRs if you prefer distinct fixing commits - I try to keep commits as small as possible while ensuring each commit is independently good to allow bisection) I've also sneaked in some serialization test fixes. Regarding the type length - you are indeed correct this is better on nightly, I've installed the toolchain to test and it passes. Until then I'm fine with the type length annotation, I thought it was for tests but it's the examples so I've added them in a new commit prior to breakage. |
Some examples no longer build after the following commits, set a bigger-than-default type_length_limit to let tests pass. The exceptions are not necessary on nightly and can be removed again after rust-lang/rust#54540 is fixed.
Rooms marked as "direct" are associated a user_id in "m.direct" events. Clients could want to handle these separately
"m.direct" events are not in room account data events but in main one
Codecov Report
@@ Coverage Diff @@
## master #104 +/- ##
==========================================
- Coverage 79.26% 78.90% -0.37%
==========================================
Files 38 38
Lines 7563 7595 +32
==========================================
- Hits 5995 5993 -2
- Misses 1568 1602 +34
Continue to review full report at Codecov.
|
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.
Thank you, fixed the comments in their original commits as a force push (please say for future PRs if you prefer distinct fixing commits - I try to keep commits as small as possible while ensuring each commit is independently good to allow bisection)
I do dislike force pushing since it's a bit easier to see the changes if no force pushing is done.
Regarding the type length - you are indeed correct this is better on nightly, I've installed the toolchain to test and it passes.
As mentioned this seems to be fixed with Rust 1.47.0.
However compilation is still awfully long (to my taste) -- for example the example login program takes over 10s to build on my laptop (build all, touch login.rs, build again).. As said multiple times I'm very new to rust so I don't really know what's normal but I a have similarily-sized toy
hyper
program that only takes ~2s to build (ruma uses hyper so it won't be faster but I'm not sure x4 is warranted?)
I think that's the linking step taking this long, considering that there won't be much new stuff to compile.
Well, I don't know. I'll still try to play with boxes and report when I figure out how to make this work -- but that's unrelated to this PR, so later :)
I don't think boxing is the right approach here, using async syntax is the preferred way as the linked github issue also suggested.
This reverts commit 7d023eb. Rust 1.47.0 got released and the tuning is no longer necessary.
I've got to say that's a github problem more than a force pushing problem. gerrit, gitlab etc do a great job with force push :P
Hard to tell with cargo but that appears correct (~4s for compilation and ~9 for linking); I guess changing things there won't help much with that..
It says |
Thanks! |
Thanks for the PR. |
Add an optional
direct_target
field toRoom
struct to track rooms marked as "direct" : for direct rooms, it will contain the associatedUserId
.Closes #103.
Notes: