Skip to content

Commit 83ce4c7

Browse files
committed
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).
1 parent 2562aa3 commit 83ce4c7

File tree

1 file changed

+0
-29
lines changed
  • testing/matrix-sdk-integration-testing/src/tests/sliding_sync

1 file changed

+0
-29
lines changed

testing/matrix-sdk-integration-testing/src/tests/sliding_sync/room.rs

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,6 @@ impl UpdateObserver {
359359
}
360360

361361
#[tokio::test]
362-
#[ignore]
363362
async fn test_room_notification_count() -> Result<()> {
364363
use tokio::time::timeout;
365364

@@ -488,20 +487,6 @@ async fn test_room_notification_count() -> Result<()> {
488487
assert_eq!(alice_room.num_unread_notifications(), 1);
489488
assert_eq!(alice_room.num_unread_mentions(), 0);
490489

491-
// If the server hasn't updated the server-side notification count yet, wait for
492-
// it and reassert.
493-
if alice_room.unread_notification_counts().notification_count != 1 {
494-
update_observer
495-
.next()
496-
.await
497-
.expect("server should update server-side notification count");
498-
assert_eq!(alice_room.unread_notification_counts().notification_count, 1);
499-
500-
assert_eq!(alice_room.num_unread_messages(), 1);
501-
assert_eq!(alice_room.num_unread_notifications(), 1);
502-
assert_eq!(alice_room.num_unread_mentions(), 0);
503-
}
504-
505490
update_observer.assert_is_pending();
506491
}
507492

@@ -525,20 +510,6 @@ async fn test_room_notification_count() -> Result<()> {
525510
assert_eq!(alice_room.num_unread_notifications(), 2);
526511
assert_eq!(alice_room.num_unread_mentions(), 1);
527512

528-
// If the server hasn't updated the server-side notification count yet, wait for
529-
// it and reassert.
530-
if alice_room.unread_notification_counts().notification_count != 2 {
531-
update_observer
532-
.next()
533-
.await
534-
.expect("server should update server-side notification count");
535-
assert_eq!(alice_room.unread_notification_counts().notification_count, 2);
536-
537-
assert_eq!(alice_room.num_unread_messages(), 2);
538-
assert_eq!(alice_room.num_unread_notifications(), 2);
539-
assert_eq!(alice_room.num_unread_mentions(), 1);
540-
}
541-
542513
update_observer.assert_is_pending();
543514
}
544515

0 commit comments

Comments
 (0)