Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes listener does not remove last item of collection #7

Open
picard315 opened this issue Jun 10, 2015 · 1 comment
Open

Changes listener does not remove last item of collection #7

picard315 opened this issue Jun 10, 2015 · 1 comment

Comments

@picard315
Copy link

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.

@picard315
Copy link
Author

Additional info:
When adding the fix from issue #6 it will still not remove the last item in the collection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant