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

Cache mixin doesn't work with Rest without an object ID when adding when using the default Memory store for the cache #218

Open
denov opened this issue Nov 29, 2017 · 0 comments
Labels

Comments

@denov
Copy link

denov commented Nov 29, 2017

using a store of [ Rest, Cache ] when you call store.add() the chain of calls is Cache.add() -> Rest.add() -> Cache.put() -> Rest.put()

in the Cache.put() function at line 147 in Cache.js - cachingStore.put(object, directives) makes a call to Memory which gives the the object an ID. this ID is then used to build the url by setting hasId to true at line 76 in Rest.js. so you end with a url like - /api/foo/0.142823

If you remove the call to cachingStore.put at line 147 and only update the cache after the master is finish things work correctly.

@dylans dylans added the bug label Dec 2, 2017
yassam added a commit to yassam/dstore that referenced this issue Mar 9, 2021
Because this hasn't been fixed upstream, I'm fixing it here.

Adding an object to a cache-backed Rest store causes what should be a
POST call to turn into a PUT call with a random id.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants