Done SyncManager._getQuery (partially tested)