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

EJSON.clone() broken for objects with a numeric "length" attribute #2

Closed
vsivsi opened this issue May 23, 2014 · 3 comments
Closed

Comments

@vsivsi
Copy link
Member

vsivsi commented May 23, 2014

This issue occurs because EJSON.clone() uses the underscore.js _.each() method to traverse objects

This is notoriously broken in underscore (see e.g. jashkenas/underscore#1590) for objects with a numeric length attribute, such as MongoDB GridFS file documents.

Meteor.js has patched its private copy of underscore to solve this issue (and likely others).

All Oortcloud projects which have adopted Meteor.js code that depends on underscore.js probably should switch to Meteor's version.

@emgee3
Copy link
Member

emgee3 commented May 24, 2014

So I agree that we should use the same version that Meteor does, using a fork of an outdated version of _ makes me sad.

@emgee3
Copy link
Member

emgee3 commented May 24, 2014

I've published updated versions of ddp-ejson, ddp-srp and node-ddp-client.

@emgee3 emgee3 closed this as completed May 24, 2014
@vsivsi
Copy link
Member Author

vsivsi commented May 24, 2014

Thanks for doing this! It makes me sad too, but we would gain nothing by trying to get out in front of Meteor on this. Have a good weekend.

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

Successfully merging a pull request may close this issue.

2 participants