Begin of SyncManager._getQuery (in progress...)