@@ -215,6 +215,17 @@ async fn test_edit_local_echo() {
215215
216216 assert ! ( timeline_stream. next( ) . now_or_never( ) . is_none( ) ) ;
217217
218+ // Set up the success response before editing, since edit causes an immediate
219+ // retry (the room's send queue is not blocked, since the one event it couldn't
220+ // send failed in an unrecoverable way).
221+ drop ( mounted_send) ;
222+ Mock :: given ( method ( "PUT" ) )
223+ . and ( path_regex ( r"^/_matrix/client/r0/rooms/.*/send/.*" ) )
224+ . respond_with ( ResponseTemplate :: new ( 200 ) . set_body_json ( json ! ( { "event_id" : "$1" } ) ) )
225+ . expect ( 1 )
226+ . mount ( & server)
227+ . await ;
228+
218229 // Let's edit the local echo.
219230 let edit_info = item. edit_info ( ) . expect ( "getting the edit info for the local echo" ) ;
220231
@@ -240,18 +251,6 @@ async fn test_edit_local_echo() {
240251 let edit_message = item. content ( ) . as_message ( ) . unwrap ( ) ;
241252 assert_eq ! ( edit_message. body( ) , "hello, world" ) ;
242253
243- // Now, reenable the send queue for that room, and observe the new event being
244- // sent.
245- drop ( mounted_send) ;
246- Mock :: given ( method ( "PUT" ) )
247- . and ( path_regex ( r"^/_matrix/client/r0/rooms/.*/send/.*" ) )
248- . respond_with ( ResponseTemplate :: new ( 200 ) . set_body_json ( json ! ( { "event_id" : "$1" } ) ) )
249- . expect ( 1 )
250- . mount ( & server)
251- . await ;
252-
253- room. send_queue ( ) . set_enabled ( true ) ;
254-
255254 // Observe the event being sent, and replacing the local echo.
256255 assert_let ! ( Some ( VectorDiff :: Set { index: 1 , value: item } ) = timeline_stream. next( ) . await ) ;
257256
0 commit comments