File tree Expand file tree Collapse file tree
server/tests/overall_common Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -302,9 +302,19 @@ pub async fn goto_line(
302302 . await
303303 . unwrap ( ) ;
304304 // The cursor movement produces a cursor/scroll position update after an
305- // autosave delay.
305+ // autosave delay. Sometimes, we get an update just before the movement; ignore that.
306+ let mut msg = codechat_server. get_message_timeout ( TIMEOUT ) . await . unwrap ( ) ;
307+ if msg. id == * client_id
308+ && let EditorMessageContents :: Update ( update) = & msg. message
309+ && update. file_path == path_str
310+ && update. contents . is_none ( )
311+ && update. cursor_position != Some ( line)
312+ {
313+ * client_id += MESSAGE_ID_INCREMENT ;
314+ msg = codechat_server. get_message_timeout ( TIMEOUT ) . await . unwrap ( ) ;
315+ }
306316 assert_eq ! (
307- codechat_server . get_message_timeout ( TIMEOUT ) . await . unwrap ( ) ,
317+ msg ,
308318 EditorMessage {
309319 id: * client_id,
310320 message: EditorMessageContents :: Update ( UpdateMessageContents {
You can’t perform that action at this time.
0 commit comments