                 @merge.putDoc doc, callback
 
     # Keep track of the sequence number and log errors
+    # TODO test pending counts
     changed: (change) =>
+        @pending++
         (err) =>
+            @pending--
             if err
                 log.error err
                 log.debug change

                    callback err
                .on 'complete', =>
                    @changes = null
                    callback()

    # Take one change from the changes feed and give it to merge
    #

        delete doc.name
        delete doc.binary
        delete doc.clearance
        delete doc.localPath
        if @merge.invalidId doc
            log.error "Invalid id"
            log.error doc
