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 async dependency in favor of promises #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

marshall007
Copy link

It appears that async is relied upon for just two calls to async.series(). Here's my attempt at replicating this behavior using a promise chain. There's still one failing test case that I can't get to pass so I'm hoping someone more familiar with the internals can take a look:

PhantomJS 1.9.7 (Mac OS X) ActiveResource Querying base#where utilizes findURL by default has associated method #all that returns all instances FAILED
    Error: Unexpected request: GET http://api.faculty.com/grid-controllers?system_id=8
    No more request expected
        at $httpBackend (/Users/marshall/Projects/ngActiveResource/bower_components/angular-mocks/angular-mocks.js:1179)
        at sendReq (/Users/marshall/Projects/ngActiveResource/bower_components/angular/angular.js:8181)
        at /Users/marshall/Projects/ngActiveResource/bower_components/angular/angular.js:7921
        at /Users/marshall/Projects/ngActiveResource/bower_components/angular/angular.js:11319
        at /Users/marshall/Projects/ngActiveResource/bower_components/angular/angular.js:11319
        at /Users/marshall/Projects/ngActiveResource/bower_components/angular/angular.js:11405
        at /Users/marshall/Projects/ngActiveResource/bower_components/angular/angular.js:12412
        at /Users/marshall/Projects/ngActiveResource/bower_components/angular/angular.js:12224
        at /Users/marshall/Projects/ngActiveResource/bower_components/angular/angular.js:12516
        at done (/Users/marshall/Projects/ngActiveResource/bower_components/angular/angular.js:8204)
        at handleResponse (/Users/marshall/Projects/ngActiveResource/bower_components/angular-mocks/angular-mocks.js:1131)
        at /Users/marshall/Projects/ngActiveResource/bower_components/angular-mocks/angular-mocks.js:1448
        at /Users/marshall/Projects/ngActiveResource/spec/angular-resource/active-resource.spec.js:1332
PhantomJS 1.9.7 (Mac OS X): Executed 329 of 329 (1 FAILED) (2.087 secs / 1.957 secs)

@marshall007
Copy link
Author

After looking into this further, I think this test case fails because the existing behavior is bugged. Calling .all() or .where() with no parameters is going to default to { lazy: false }. As a result, isn't the expected behavior in this test to eagerly fetch the hasOne relationships (i.e. the GridController associated with each system) as well?

@hyperborea
Copy link

+1
I'd love to drop the dependency to async and meld isn't used anywhere either.

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 this pull request may close these issues.

2 participants