Skip to content

Changes listener does not remove last item of collection #7

@picard315

Description

@picard315

I don't know why this happens, but i deleted the last item of a collection using the couchdb web interface.
Strangely the browser seems to skip the removeChild command in the following block:

          } else if (collection.length && indexes[change.id]) { //DELETE
            removeChild(change.id);
            updateIndexes(indexes[change.id]);
          }

Happened on Firefox 38.0 on CentOS.

Replacing the condition with collection.length && (indexes[change.id] != undefined) fixes the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions