@@ -1108,6 +1108,11 @@ mod private {
11081108 {
11091109 self . state . room_linked_chunk . revents ( ) . find_map ( |( _position, event) | predicate ( event) )
11101110 }
1111+
1112+ #[ cfg( test) ]
1113+ pub fn is_dirty ( & self ) -> bool {
1114+ EventCacheStoreLockGuard :: is_dirty ( & self . store )
1115+ }
11111116 }
11121117
11131118 impl < ' a > RoomEventCacheStateLockWriteGuard < ' a > {
@@ -2072,6 +2077,11 @@ mod private {
20722077
20732078 Ok ( ( ) )
20742079 }
2080+
2081+ #[ cfg( test) ]
2082+ pub fn is_dirty ( & self ) -> bool {
2083+ EventCacheStoreLockGuard :: is_dirty ( & self . store )
2084+ }
20752085 }
20762086
20772087 /// Load a linked chunk's full metadata, making sure the chunks are
@@ -4114,6 +4124,9 @@ mod timed_tests {
41144124 // shared access.
41154125 // See `RoomEventCacheStateLock::read` to learn more.
41164126
4127+ // The lock is no longer marked as dirty, it's been cleaned.
4128+ assert ! ( guard. is_dirty( ) . not( ) ) ;
4129+
41174130 // The reload can be observed via the updates too.
41184131 assert_matches ! (
41194132 updates_stream. recv( ) . await . unwrap( ) ,
@@ -4167,6 +4180,9 @@ mod timed_tests {
41674180 // Guard is kept alive, to ensure we can have multiple read guards alive with a
41684181 // shared access.
41694182
4183+ // The lock is no longer marked as dirty, it's been cleaned.
4184+ assert ! ( guard. is_dirty( ) . not( ) ) ;
4185+
41704186 // The reload can be observed via the updates too.
41714187 assert_matches ! (
41724188 updates_stream. recv( ) . await . unwrap( ) ,
@@ -4220,6 +4236,9 @@ mod timed_tests {
42204236
42214237 let guard = room_event_cache. inner . state . write ( ) . await . unwrap ( ) ;
42224238
4239+ // The lock is no longer marked as dirty, it's been cleaned.
4240+ assert ! ( guard. is_dirty( ) . not( ) ) ;
4241+
42234242 // The reload can be observed via the updates too.
42244243 assert_matches ! (
42254244 updates_stream. recv( ) . await . unwrap( ) ,
@@ -4267,6 +4286,9 @@ mod timed_tests {
42674286
42684287 let guard = room_event_cache. inner . state . write ( ) . await . unwrap ( ) ;
42694288
4289+ // The lock is no longer marked as dirty, it's been cleaned.
4290+ assert ! ( guard. is_dirty( ) . not( ) ) ;
4291+
42704292 // The reload can be observed via the updates too.
42714293 assert_matches ! (
42724294 updates_stream. recv( ) . await . unwrap( ) ,
0 commit comments