               'query': (opts.query || {})
             }
             fetchAllPaginated(field, action, o)
+          else
+            # end the querying indicator
+            delete $scope.querying[field]
         # error handling
         , () ->
           # if we got an error on the first fetch, try again without pagination

      x instanceof Array and x.length == 0

    fetchAllUnpaginated = (field, action, opts = {}) ->
      # fetch the field
      Restangular.all(field).getList( opts.query || {} ).then(
        (data) ->
          # if we have a result, process it
          console.log "fetched #{field} (no pagination)"
          action(data)
        , () ->
          # otherwise we have a fetch error
          fetchError("fetch #{field} (no pagination)")
        )

    fetchAllPaginated = (field, action, opts = {})->
      stop_when = opts.stop_when || isEmptyArray
      page = opts.page || 1
      limit = opts.limit || 50
      # construct a query for pagination
      query = _.merge(
        {page: page, limit: limit},

    $scope.node = {}
    $scope.package = {}
    $scope.packageByName = {}
    $scope.querying = {}

    $scope.show = {}
    $scope.nodeVisible = {}
