-
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
send queue: allow sending reactions to local echoes #3749
Conversation
106b552
to
69b9379
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3749 +/- ##
==========================================
+ Coverage 84.09% 84.13% +0.04%
==========================================
Files 266 266
Lines 27861 27996 +135
==========================================
+ Hits 23429 23554 +125
- Misses 4432 4442 +10 ☔ View full report in Codecov by Sentry. |
6611815
to
4835265
Compare
So, some jobs have been failing here with an error like this:
We're making a library, so it's a big no-no to add the requirement that every user adds the The issue is that when trying to evaluate if a type is A workaround that's been explained to me by a rustc friend: it's possible to "break up" the call tree by adding an Now, it happens that
This is a bit hacky, and I hope the next solver will do better; in the meanwhile, is it an acceptable tradeoff? [edit] doesn't work for the doc build, which hits the same issue involving only Ruma types, it seems 👀 [edit 2] works when put on |
…unds in rustc See #3749 (comment) for the gory details.
4835265
to
3fc561d
Compare
…unds in rustc See #3749 (comment) for the gory details.
3fc561d
to
c9e9580
Compare
…unds in rustc See #3749 (comment) for the gory details.
c9e9580
to
a83f6b6
Compare
…unds in rustc See #3749 (comment) for the gory details.
a83f6b6
to
a802940
Compare
Hello @bnjbvr , testing the branch on EXA. Note: I use the in online mode:
I cannot test adding reaction on not sent message, I need to do some change on the application to be able to do that, but I will let you know what the result of this test. |
@bmarty Yeah, you need to pass the "internal_id()" or "unique_id()" for the item; this was a way to avoid having to deal with passing an |
OK, thanks, passing the I have found a scenario which is failing though:
Nothing should happen, but at the end the reaction is redacted. See the video below: |
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.
Lot of code. Not sure I'm having all the details but it looks good! Well done.
Now, let's see how many persons will react to their own local event…
#[derive(Clone, Debug)] | ||
pub enum LocalEchoContent { | ||
/// The local echo contains an actual event ready to display. | ||
Event { |
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.
Do you imagine adding Media
in a close future?
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.
Yes, that's the idea!
@@ -1019,6 +1019,9 @@ impl QueueStorage { | |||
.map_err(RoomSendQueueStorageError::StorageError)?; | |||
|
|||
let num_initial_dependent_events = dependent_events.len(); | |||
if num_initial_dependent_events == 0 { | |||
return Ok(()); |
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.
Why is it useful to return early? To avoid calling canonicalize_dependent_events
? Is it necessary to add a comment?
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.
It avoided a few spurious log lines below; will comment briefly there.
let Some(remote_event_item) = event_item.as_remote() else { | ||
error!("received reaction to a local echo"); | ||
return; | ||
}; |
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.
Niice.
// See https://github.com/matrix-org/matrix-rust-sdk/pull/3749#issuecomment-2312939823. | ||
#[cfg(not(feature = "test-send-sync"))] | ||
unsafe impl Send for Room {} | ||
|
||
// See https://github.com/matrix-org/matrix-rust-sdk/pull/3749#issuecomment-2312939823. | ||
#[cfg(not(feature = "test-send-sync"))] | ||
unsafe impl Sync for Room {} | ||
|
||
#[cfg(feature = "test-send-sync")] | ||
#[test] | ||
// See https://github.com/matrix-org/matrix-rust-sdk/pull/3749#issuecomment-2312939823. | ||
fn test_send_sync_for_room() { | ||
fn assert_send_sync<T: Send + Sync>() {} | ||
|
||
assert_send_sync::<Room>(); | ||
} |
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.
<3
a802940
to
b94a6e6
Compare
@bmarty opened a followup for the issue you've found, since it's unfortunately not trivial to handle. Thanks though! |
Fixes #3663.