Coder Social home page Coder Social logo

Comments (7)

chbonser avatar chbonser commented on August 28, 2024 1

Thanks @dgeb. I'll try to carve out some time later today to create a simplified reproduction.

from ember-orbit.

dgeb avatar dgeb commented on August 28, 2024

@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.

dgeb avatar dgeb commented on August 28, 2024

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.

chbonser avatar chbonser commented on August 28, 2024

@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.

dgeb avatar dgeb commented on August 28, 2024

@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.

chbonser avatar chbonser commented on August 28, 2024

@dgeb I upgraded to ember-orbit beta 16 and I'm seeing the same error. See forge512/orbit-demo#1

from ember-orbit.

dgeb avatar dgeb commented on August 28, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.