           type: 'unpersist'
         nextModels: 'unchanged'
         mustUpdate: false
-        mustRefetchAllIds: false
       }]
 
     },{

            subscription._updateInFlight = false
            subscription.applyChangeRecord(test.change)

            if test.mustRefetchAllIds
              expect(subscription._set).toBe(null)
            else if test.nextModels is 'unchanged'
              expect(subscription._set.models()).toEqual(scenario.lastModels)
            else
              expect(subscription._set.models()).toEqual(test.nextModels)

            if test.mustUpdate
              expect(subscription.update).toHaveBeenCalled()

            if test.mustTriger
              expect(subscription._createResultAndTrigger).toHaveBeenCalled()

  describe "update", ->
    beforeEach ->
      spyOn(QuerySubscription.prototype, '_fetchMissingRange').andCallFake ->
        @_set ?= new MutableQueryResultSet()
        Promise.resolve()

    describe "when the query has an infinite range", ->
      it "should call _fetchMissingRange for the entire range", ->
        subscription = new QuerySubscription(DatabaseStore.findAll(Thread))
        subscription.update()
        advanceClock()
        expect(subscription._fetchMissingRange).toHaveBeenCalledWith(QueryRange.infinite(), {fetchEntireModels: true, version: 1})

      it "should fetch full full models only when the previous set is empty", ->
        subscription = new QuerySubscription(DatabaseStore.findAll(Thread))

          new Thread(accountId: 'a', clientId: '1', lastMessageReceivedTimestamp: 1),
        ]
        mustUpdate: true
      },{
        name: 'Item in set deleted'
        change:
