Comments (7)
Thanks @dgeb. I'll try to carve out some time later today to create a simplified reproduction.
from ember-orbit.
@chbonser thanks for the detailed report.
A few questions to narrow my focus:
- Can this be reproduced with just a store and no remote (i.e. no active coordination strategies)?
- Can it be reproduced by directly without the mutation fork, but by simply deleting the record in the display fork and then rebasing?
from ember-orbit.
The eventRecord record has been removed from its cache, so we cannot lookup the resultTimeSource attribute.
Models will display this error (or similar) when any data is accessed after they have been removed from their corresponding cache. I would expect that a model that's been deleted but is still rendered in the template to raise this exception.
Is the eventRecord
in question connected with the display fork and deleted in the mutation fork? Does this error also happen if you don't do the rebase?
Sorry for all the questions. Feel free to answer with a reproduction if that would be simpler.
from ember-orbit.
@dgeb I was able to reproduce this with a fairly simple setup. Please see the video in this PR forge512/orbit-demo#1
from ember-orbit.
@chbonser thanks for the reproduction.
What's happening here is that, as of #321, the store became a @tracked
property on the model. This was later changed to the cache, but effectively it's the same. When a record is removed from the cache, the model is disconnected, meaning it's no longer connected to a store / cache. If store / cache is tracked, then this invalidates every property on the model that was computed based on the store / cache.
I think that the assertions introduced in the field getters for #321 are correct, since they provide a useful error for why field values can not be retrieved from a disconnected model. However, as you show in this example, it's likely that the immediate invalidation of all fields on a model due to making store / cache tracked is a bit aggressive.
The question is whether any representation of a model should be immediately invalidated when that model is removed from its cache? I think the answer is likely "no" as your example shows. Otherwise, no resultsets could ever be considered "static".
I think we should probably remove cache tracking from models to eliminate this breaking change from v0.17.
from ember-orbit.
@dgeb I upgraded to ember-orbit beta 16 and I'm seeing the same error. See forge512/orbit-demo#1
from ember-orbit.
@chbonser sorry about that, I see what happened. I'll follow up with another PR soon with a fix and a better test.
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
- 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.