                 }
             }
             
+            MXLog.debug("[MXSyncResponseStoreManager] mergedSyncResponse: merging \(responseIds.count) sync responses lasted \(stopwatch.readable())")
+            
             if let result = result {
                 DispatchQueue.main.async {
                     completion(MXCachedSyncResponse(syncToken: syncToken,

    //  MARK: - Private
    
    private func merged(_ newSyncResponse: MXSyncResponse, onto oldSyncResponse: MXSyncResponse) -> MXSyncResponse {
        //  handle new limited timelines
        newSyncResponse.rooms?.joinedOrLeftRoomSyncs?.filter({ $1.timeline.limited == true }).forEach { (roomId, _) in
            if let joinedRoomSync = oldSyncResponse.rooms?.join?[roomId] {

        // Merge the new sync response to the old one
        var dictionary = NSDictionary(dictionary: oldSyncResponse.jsonDictionary())
        dictionary = dictionary + NSDictionary(dictionary: newSyncResponse.jsonDictionary())
        
        MXLog.debug("[MXSyncResponseStoreManager] merged: merging two sync responses lasted \(stopwatch.readable())")
        
        return MXSyncResponse(fromJSON: dictionary as? [AnyHashable : Any])
    }
