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

Eagerly loaded side relations don't get cached #536

Open
zeesulehria opened this issue Apr 23, 2019 · 2 comments
Open

Eagerly loaded side relations don't get cached #536

zeesulehria opened this issue Apr 23, 2019 · 2 comments
Labels
mapper relations Mapper relations are the ability to define a relationship one Mapper has with another Mapper

Comments

@zeesulehria
Copy link

Description

If I load a relation record indirectly via with: [] param, it is not stored in cache and next direct find request to that record fired request to adapter.

Steps to reproduce:

  1. Eagerly load relation like: store.find('invoice', id, { with: ['saleOrder'] })
  2. Then fetch same relation record using: store.find('saleOrder', id)
    The call in 2 fires http request even when we have fetched that record already as part of 1.

Environment

  • js-data version:
    "js-data": "^3.0.5",
    "js-data-http": "^3.0.1",
  • node or browser version: v10.7.0
  • operating system: MacOS
@Tyler-Zhang
Copy link

Tyler-Zhang commented Jul 16, 2019

I'm also running into this issue.

It only occurs when the record I'm finding has been queried before (without the with).

@zeesulehria
Copy link
Author

Not sure. I don't see this issue when I directly query an endpoint (in which case data is retrieved correctly in subsequent call). For me it happens only with indirect relations loading via with..

@crobinson42 crobinson42 added the mapper relations Mapper relations are the ability to define a relationship one Mapper has with another Mapper label Jan 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mapper relations Mapper relations are the ability to define a relationship one Mapper has with another Mapper
Projects
None yet
Development

No branches or pull requests

3 participants