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

.remove fails if you restart the server OR insert a new item with .save #6

Open
stagas opened this issue Aug 11, 2010 · 2 comments
Open

Comments

@stagas
Copy link

stagas commented Aug 11, 2010

At first it looks as if the entry is removed, but if I restart the server, or save a new item the removed entry reappears.

@stagas
Copy link
Author

stagas commented Aug 12, 2010

Might be more than a bug in remove, check this gist http://gist.github.com/520485 , it fails after a save - get - remove - save.

@stuarts
Copy link

stuarts commented Oct 7, 2011

Hmm one problem is that in checkQueue, the key is removed from the index if value.length === 0 but promptly re-added if value !== undefined.

234 updates.forEach(function (value, key) { 235 if (self.index.hasOwnProperty(key)) { 236 self.stale++; 237 if (value.length === 0) { 238 delete self.index[key]; 239 } 240 } 241 if (value !== undefined) { 242 self.index[key] = value; 243 } 244 });

Either the deletion should happen after the update or the update should be:
241 if (value !== undefined && value.length !== 0) { 242 self.index[key] = value; 243 } 244 });

Its late here, so I'm not going to fork tonight and submit tonight.

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

2 participants