From 83ce4c7ca275146ff0bc3e05cefb5059d86e80ff Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Wed, 25 Sep 2024 15:21:21 +0200 Subject: [PATCH] test(integration): Fix `test_room_notification_count`. This test was failing since the migration from the sliding sync proxy to Synapse. This patch fixes the test. The failing parts were: 1. The `timeline_limit` wasn't set, so Synapse was returning an error, 2. The `unread_notifications` was set to 0 and could not be set to 1 because that's an encrypted room. The fact `timeline_limit` is now mandatory has been mentioned in the MSC: https://github.com/matrix-org/matrix-spec-proposals/pull/4186/files#r1775138458 A patch in Ruma has been created. The previous patch in this repository also contains the fix for the SDK side. The assertions around `unread_notifications` have been removed. We no longer use this API anymore (and it should be deprecated by the way). --- .../src/tests/sliding_sync/room.rs | 29 ------------------- 1 file changed, 29 deletions(-) diff --git a/testing/matrix-sdk-integration-testing/src/tests/sliding_sync/room.rs b/testing/matrix-sdk-integration-testing/src/tests/sliding_sync/room.rs index baeb3ca8a..f70288ab4 100644 --- a/testing/matrix-sdk-integration-testing/src/tests/sliding_sync/room.rs +++ b/testing/matrix-sdk-integration-testing/src/tests/sliding_sync/room.rs @@ -359,7 +359,6 @@ impl UpdateObserver { } #[tokio::test] -#[ignore] async fn test_room_notification_count() -> Result<()> { use tokio::time::timeout; @@ -488,20 +487,6 @@ async fn test_room_notification_count() -> Result<()> { assert_eq!(alice_room.num_unread_notifications(), 1); assert_eq!(alice_room.num_unread_mentions(), 0); - // If the server hasn't updated the server-side notification count yet, wait for - // it and reassert. - if alice_room.unread_notification_counts().notification_count != 1 { - update_observer - .next() - .await - .expect("server should update server-side notification count"); - assert_eq!(alice_room.unread_notification_counts().notification_count, 1); - - assert_eq!(alice_room.num_unread_messages(), 1); - assert_eq!(alice_room.num_unread_notifications(), 1); - assert_eq!(alice_room.num_unread_mentions(), 0); - } - update_observer.assert_is_pending(); } @@ -525,20 +510,6 @@ async fn test_room_notification_count() -> Result<()> { assert_eq!(alice_room.num_unread_notifications(), 2); assert_eq!(alice_room.num_unread_mentions(), 1); - // If the server hasn't updated the server-side notification count yet, wait for - // it and reassert. - if alice_room.unread_notification_counts().notification_count != 2 { - update_observer - .next() - .await - .expect("server should update server-side notification count"); - assert_eq!(alice_room.unread_notification_counts().notification_count, 2); - - assert_eq!(alice_room.num_unread_messages(), 2); - assert_eq!(alice_room.num_unread_notifications(), 2); - assert_eq!(alice_room.num_unread_mentions(), 1); - } - update_observer.assert_is_pending(); }