File tree 1 file changed +21
-0
lines changed
crates/matrix-sdk-sqlite/src 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -1915,6 +1915,27 @@ mod tests {
1915
1915
let chunks = store. load_all_chunks ( room_id) . await . unwrap ( ) ;
1916
1916
assert ! ( chunks. is_empty( ) ) ;
1917
1917
1918
+ // Check that cascading worked. Yes, sqlite, I doubt you.
1919
+ store
1920
+ . acquire ( )
1921
+ . await
1922
+ . unwrap ( )
1923
+ . with_transaction ( |txn| -> rusqlite:: Result < _ > {
1924
+ let num_gaps = txn
1925
+ . prepare ( "SELECT COUNT(chunk_id) FROM gaps ORDER BY chunk_id" ) ?
1926
+ . query_row ( ( ) , |row| row. get :: < _ , u64 > ( 0 ) ) ?;
1927
+ assert_eq ! ( num_gaps, 0 ) ;
1928
+
1929
+ let num_events = txn
1930
+ . prepare ( "SELECT COUNT(event_id) FROM events ORDER BY chunk_id" ) ?
1931
+ . query_row ( ( ) , |row| row. get :: < _ , u64 > ( 0 ) ) ?;
1932
+ assert_eq ! ( num_events, 0 ) ;
1933
+
1934
+ Ok ( ( ) )
1935
+ } )
1936
+ . await
1937
+ . unwrap ( ) ;
1938
+
1918
1939
// It's okay to re-insert a past event.
1919
1940
store
1920
1941
. handle_linked_chunk_updates (
You can’t perform that action at this time.
0 commit comments