Skip to content

first request to findAll does not resolve correctly #1013

@dagda1

Description

@dagda1

I am using the latest from master (revision 13)

I am finding that the first request to any resource returns 0 records on the first call to findAll, for example

App.Contact.find().then (contacts) ->
  console.log contacts.get('length')

What I am finding is that the console.log statement above will log 0 but if I then type:

App.Contact.find().get('length')

into the console after the page has refreshed and a call to findAll has been made, the length is as I would expect, i.e. greater than 0.

This happens for any resource, I have stepped through the code and the json is getting materialized into the models but for some reason, the record array is empty.

I have stepped through the code and it appears that the promise is resolving before didFIndAll is called.

I cannot create a fiddle for this as it is only happening with the rest adapter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions