Comments (14)
I'm using blocking connectors.
With the non-inverse workaround I had trouble creating child objects, so I brought it back. According to the README it should anyway be always there, so that Orbit takes care of relations.
But now I get the same error on delete and on create: can do it only once. Then, it doesn't work any longer. Reload and the same. Clear localStorage and reload, and can create or delete one more time again. I'm lost and fearful of state. :)
from ember-orbit.
Last attempt of sharing debugging info for today: I many times get to the error logged in https://github.com/orbitjs/ember-orbit/blob/master/lib/ember-orbit/record-array-manager.js#L77 (something like !!!! unhandled change 5 ["farm", "21c904de-f3dd-47df-ad1b-ea3981545ccb", "__rel", "plots", "3a18d0e5-b9f7-31d5-288f-151493e303e3"], value: true
, for replace op).
And as a workaround to not send __rel
updates to the server I did the following commit, which I'm somewhat ashamed to share, but hopefully we both come to a nice solution: tute/orbit.js@a4b1147
from ember-orbit.
Just saw https://github.com/orbitjs/orbit.js/blob/master/test/tests/orbit_common/unit/memory-source-test.js#L55-L173 (TODO - fixup transform tests
). Related maybe?
from ember-orbit.
@tute I'm sorry for the trouble you're having. I'm going to review orbitjs/orbit#43 very soon, then review JSON API compliance in general, and then will help you resolve any problems that remain on your end.
from ember-orbit.
@tute do you have a code example that you can share that shows how you connected the memory and JSONAPI sources?
I found this, #15 (comment) perhaps I can use this example as a template for connecting memory and JSONAPI sources.
from ember-orbit.
@pixelhandler it's this sample: #15 (comment). With the addition of non-blocking "two-way" connector between localStorage and JSON API.
For now I'm working with memory-localStorage, and now working in syncing "by hand" the localStorage JSON payload with the server in a custom action, until we have a compliant adapter. It was surprisingly hard to track where the promises fail.
from ember-orbit.
@tute thanks for the example, I was able to connect memory and JSONAPI sources like so, https://github.com/pixelhandler/blog/blob/try-ember-orbit-with-ember-cli/client/app/initializers/ember-orbit.js I'll try out adding a relationship next.
from ember-orbit.
@dgeb I just found this error is not specific for JSON API. Connecting only memory to localStorage, non blocking, and the two models together with their inverses, upon deletion I get the dreaded failed Promise, that I still can't track down on why it does fail. Stack Trace from Ember inspector in Chrome:
at new Promise
at Evented.interface.resolve
at Requestable.defineAction.object.(anonymous function) [as removeLink]
at Source.extend.removeLink
at RecordArray.extend.arrayContentWillChange
at apply
at superWrapper [as arrayContentWillChange]
at EmberObject.extend.arrangedContentArrayWillChange
at applyStr
path is:
path: Array[5]
0: "farm"
1: "ca6a9ed9-d05c-4e95-af70-38e410b5d9f7"
2: "__rel"
3: "plots"
4: "eed7a78b-53dc-4e01-993d-75e623e45121"
from ember-orbit.
Workaround (at last one that allows me to continue performing operations and seemingly works well): Pass an empty array instead of ops
in _removeLinks
: https://github.com/orbitjs/orbit.js/blob/master/lib/orbit-common/source.js#L193, effectively ignoring removal of links.
from ember-orbit.
@tute I need to write a failing test, but I'm curious whether your problem is solved by commenting out the following lines instead: https://github.com/orbitjs/orbit.js/blob/master/lib/orbit-common/source.js#L181-191
from ember-orbit.
I tried that, it didn't change the behavior. If it helps, given I probably can't specify the issue in enough detail, I can record a video for you of the failure, or can give you access to the running app in development.
from ember-orbit.
@dgeb @tute I was not able to use relationships for my test (blog) app. I setup Post and Author models (post hasOne author and author hasMany posts). But, the post didn't load the related author using the links property for the author by id. I had errors about path not found. I noticed commented out tests for EO.hasOne so figured that relation may still be a TODO.
from ember-orbit.
@tute @pixelhandler I've recently made quite a few updates to relationships, both in orbit and ember-orbit. Management of inverse relationships is now done in each source's transform
method, since some sources will want to let the backend handle them. Furthermore, relationships can now be set on object creation.
Please give the latest versions of orbit (0.5.2) and ember-orbit (0.4.0) a try and reopen this or another issue if you're still having trouble with relationships. Thanks!
from ember-orbit.
@dgeb thanks for pinging me it's about time I update my Orbit.js and ember-orbit versions, thanks!
from ember-orbit.
Related Issues (20)
- TS issues HOT 2
- Dependencies not defined in ember-orbit, like @orbit/local-storage-bucket not propagated through addons HOT 1
- Adding a validation function to the data models in orbit HOT 2
- Merging a fork when using IndexedDb causes error HOT 3
- Integrating with newer test waiters system HOT 5
- Provide better integration with Ember's new test waiters system
- Throws unintended exception while trying to assert about hasMany with no arg HOT 1
- Best pattern for load+fork HOT 4
- Synchronous in-memory addRecord HOT 4
- Detecting yet-to-be-loaded models HOT 4
- IndexedDB error adding new model type HOT 4
- [Beta 15] Removed from cache errors HOT 7
- Improve handling of bucket injections for ember v4 compat.
- Upgrading to 0.17 with custom serializers HOT 1
- No 'attributes' saved to indexeddb HOT 1
- Access to relationships.*.data.id HOT 3
- Irregular noun record type doesn't sync to store HOT 4
- The get attribute cache lookup error is hard to debug
- Included ( second level ) data is not passing through Orbit if they are not cached !
- Typescript compatibility issues HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-orbit.