Comments (8)
This was fixed in later versions. Broad strokes hasDirtyAttributes
responding true
for isDeleted
is a mistake we don't want to carry forward to the replacement for @ember-data/model but it is one we intend to support until then.
If @fivetanley or @richgt wants to get this change into 4.4 then it shouldn't be hard to backport.
from data.
@runspired sorry do you mean hasDirtyAttributes
being set to true by deleteRecord
is a mistake?
the document says otherwise tho https://api.emberjs.com/ember-data/4.4/classes/Model/properties/isDeleted?anchor=isDeleted
from data.
@jayseo5953 yes, it was a mistake that we did that is what I mean. hasDirtyAttributes
should mean only "do I have dirty attributes" not "do I have dirty attributes or am I deleted".
Newer cache APIs allow us to differentiate these things and also provide access to whether relationships are dirty. We should likely have a single isDirty
check that is a macro across cache.isDeleted / cache.isNew / cache.hasChangedAttrs / cache.hasChangedRelationships
from data.
@runspired right ok thanks for confirmation. Maybe the doc needs editing then?
from data.
@jayseo5953 no the docs are right and its a bug that in 4.4 it doesn't work that way. There's two different points being made here:
- that there is a bug in 4.4 that is fixed in later releases that maybe we should backport to 4.4
- that the bug is due to us supporting an undesirable behavior which we want to change in the future
I only mention (2) because for folks converting from @ember-data/model to @warp-drive/schema-record the 1:1 migration path will be to check both [STATE].isDeleted
and [STATE].hasChangedAttrs
, and to a certain degree its probably better to bake the assumption that you need to check both into your code in advance.
from data.
@runspired would you be able to point me to the closest version that has the fix? if it was fixed in minor versions
from data.
@jayseo5953 according to git blame the fix was part of this PR #8849 (I recalled it being older than this but alas). That PR is currently part of 5.3, but we intend to port its work back to the 4.12 LTS
from data.
@runspired thank you!
from data.
Related Issues (20)
- 🛤️ tracking: The Road to Polaris ✨ HOT 4
- Request can't handle `null` as response HOT 3
- Overridden `Model` methods have incorrect `this` type HOT 1
- Custom model instances’ type is not assignable to `Model` HOT 1
- EmberData's native types don't compile with glint HOT 9
- @ember-data/debug/data-adapter.js: Cannot read properties of undefined (reading 'env') HOT 2
- The kind `collection` is missing in schema-record HOT 2
- "Cannot supply a different store via context than was used to create the request" on autorefresh HOT 2
- Error `Cannot read properties of undefined (reading 'env')` after updating to 5.3.4 (extending `@ember-data/store`) HOT 12
- [5.3.4] EmberData deprecation for `ember-inflector` is incorrect HOT 1
- inspector cannot inspect ember-data - ember-data/debug is missing app-reexports HOT 10
- [5.3.7] Issue with use in nested addon HOT 4
- [5.3.7] when using ember-cli-mirage `ember-inflector` must be a installed, otherwise production build is broken HOT 2
- [5.4.0-alpha.91] Incorrect/Missing typings HOT 4
- Error: Could not find module `@ember-data/adapter/rest` HOT 1
- [5.3.4+] `polyfillUUID` isn't anymore working when there was added over `@embroider/macros` option HOT 1
- Descendants of 'Model' cannot be upcast HOT 1
- 'options' is undefined for 'attr<BooleanTransform>'
- Cannot get the Identifier of the record HOT 10
- spec: cache v3 exploration
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 data.