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

Collection.fetch( options ); #9

Closed
elquedro opened this issue Apr 11, 2012 · 1 comment
Closed

Collection.fetch( options ); #9

elquedro opened this issue Apr 11, 2012 · 1 comment

Comments

@elquedro
Copy link

When using Collection.fetch to fetch a whole collection then the error and success callbacks are removed from the options argument.

As noticed from the comment, these callbacks should not be send to the backend. But these callbacks are removed (browser.js line 14 & 15) before the if-statement (browser.js line 17) that checks for if we are working with a backend. Now normal loaded collections do not work, they only work when used with a backend.

old:

    // Don't pass the callbacks to the backend
    delete options.error;
    delete options.success;

    if (backend) {
        // Use Socket.IO backend

new:

    if (backend) {
       // Don't pass the callbacks to the backend
       delete options.error;
       delete options.success;

       // Use Socket.IO backend

My non-backend collection now works when I move the delete commands to the body of the if-statement.

Does this fix break anything that I am not aware of?

@scttnlsn
Copy link
Owner

Thanks for pointing this out. Committed the fix.

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