matrix-rust-sdk icon indicating copy to clipboard operation
matrix-rust-sdk copied to clipboard

Bumping async_stream causes test failures

Open poljar opened this issue 10 months ago • 1 comments

As discovered in #4596, updating async-stream cause some tests to fail.

The reason the identity_status_changes test fail is because the event handler for the m.room.member event registered over here:

https://github.com/matrix-org/matrix-rust-sdk/blob/8d27b0c811c96d00673eb43b0a813bb3bcf26542/crates/matrix-sdk/src/room/identity_status_changes.rs#L178-L193

isn't called anymore. As we can see, we create a drop guard for the event handler. So once the guard is dropped the handler is removed. The drop guard gets moved into a stream over here:

https://github.com/matrix-org/matrix-rust-sdk/blob/8d27b0c811c96d00673eb43b0a813bb3bcf26542/crates/matrix-sdk/src/room/identity_status_changes.rs#L93-L123

This means that the handler should be alive as long as the stream is alive, but as it seems something changed between async_stream version 0.3.5 and 0.3.6 and the drop guard gets dropped before the stream is.

Downgrading async_stream fixes the issue. The only relevant change seems to be in this PR: https://github.com/tokio-rs/async-stream/commit/97d1d3e6de46ef768567aecceb6235847bb65e35.

poljar avatar Jan 31 '25 16:01 poljar

Maybe asynk-strim will work?

jplatte avatar Nov 08 '25 20:11 jplatte