                     expectation?.fulfill()
                 }
             }
-            
-            let messages = (1...Constants.numberOfMessagesForLimitedTest).map({ "\(Constants.messageText) - \($0)" })
-            room.sendTextMessages(messages: messages) { (response) in
-                switch response {
-                case .success(let eventIDs):
-                    
-                    guard let firstEventId = eventIDs.first, let lastEventId = eventIDs.last else {
-                        XCTFail("Cannot set up initial test conditions - error: room cannot be retrieved")
-                        expectation?.fulfill()
-                        return
-                    }
-                    
-                    self.bgSyncService = MXBackgroundSyncService(withCredentials: bobCredentials)
-
-                    self.bgSyncService?.event(withEventId: lastEventId, inRoom: roomId) { (response) in
-                        switch response {
-                        case .success(let event):
-                            let text = event.content["body"] as? String
-                            XCTAssertEqual(text, "\(Constants.messageText) - \(Constants.numberOfMessagesForLimitedTest)", "Event content should match")
-
-                            let syncResponseStore = MXSyncResponseFileStore()
-                            syncResponseStore.open(withCredentials: bobCredentials)
-                            XCTAssertNil(syncResponseStore.event(withEventId: firstEventId, inRoom: roomId), "First event should not be present in sync response store")
-                            XCTAssertNotNil(syncResponseStore.event(withEventId: lastEventId, inRoom: roomId), "Last event should be present in sync response store")
-                            
-                            let syncResponse = syncResponseStore.syncResponse
-                            XCTAssertNotNil(syncResponse, "Sync response should be present")
-                            XCTAssertTrue(syncResponse!.rooms.join[roomId]!.timeline.limited, "Room timeline should be limited")
-                            
-                            var localEcho: MXEvent?
-                            room.sendTextMessage(Constants.messageText, localEcho: &localEcho) { (response2) in
-                                switch response2 {
-                                case .success(let eventId):
-                                    guard let eventId = eventId else {
-                                        XCTFail("Cannot set up initial test conditions - error: room cannot be retrieved")
-                                        expectation?.fulfill()
-                                        return
-                                    }
-                                    
-                                    self.bgSyncService = MXBackgroundSyncService(withCredentials: bobCredentials)
-
-                                    self.bgSyncService?.event(withEventId: eventId, inRoom: roomId) { (response) in
-                                        switch response {
-                                        case .success:
-                                            XCTAssertTrue(syncResponse!.rooms.join[roomId]!.timeline.limited, "Room timeline should still be limited")
-                                        case .failure(let error):
-                                            XCTFail("Cannot fetch the event from background sync service - error: \(error)")
-                                            expectation?.fulfill()
-                                        }
-                                    }
-                                    
-                                case .failure(let error):
-                                    XCTFail("Cannot set up initial test conditions - error: \(error)")
-                                    expectation?.fulfill()
-                                }
-                            }
-
-                        case .failure(let error):
-                            XCTFail("Cannot fetch the event from background sync service - error: \(error)")
-                            expectation?.fulfill()
-                        }
-                    }
-                case .failure(let error):
-                    XCTFail("Cannot set up initial test conditions - error: \(error)")
-                    expectation?.fulfill()
-                }
-            }
 
         }
     }

                            
                            var syncResponse = syncResponseStore.syncResponse
                            XCTAssertNotNil(syncResponse, "Sync response should be present")
                            XCTAssertFalse(syncResponse!.rooms.join[roomId]!.timeline.limited, "Room timeline should not be limited")
                            
                            //  then send a lot of messages

        }
    }
    
    // Nonimal test: A single event sent after a limited timeline does not change the limited timeline flag in the MXSyncResponseStore
    // - Alice and Bob are in a room
    // - Bob stops their app
    // - Alice sends a lot of messages (enough for a sync response timeline to be limited)
    // - Bob uses the MXBackgroundSyncService to fetch the last event
    // -> The message (last) can be read from MXBackgroundSyncService
    // -> The first message is not present in MXSyncResponseStore
    // -> The sync response in the MXSyncResponseStore has a limited timeline
    // - Alice send another single message
    // - Bob uses the MXBackgroundSyncService to fetch the event
    // -> The sync response in the MXSyncResponseStore has still a limited timeline
    func testWithPlainEventAfterLimitedTimeline() {
        let aliceStore = MXMemoryStore()
        let bobStore = MXFileStore()
