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

Calling rollbackAttributes on new records doesn't remove them from relationships #8792

Closed
Windvis opened this issue Aug 23, 2023 · 2 comments

Comments

@Windvis
Copy link
Contributor

Windvis commented Aug 23, 2023

Reproduction

Description

Calling rollbackAttributes on a new record no longer removes it from relationships on other (newly created) records. If you then also call rollbackAttributes on the other record a Expected a stable identifier exception is thrown because EmberData tries to unload the related record (that was already unloaded).

This started happening after updating to EmberData v4.7+.

Versions

Run the following command and paste the output below: pnpm list ember-source && pnpm list ember-cli && pnpm list --pattern ember-data.

cli output
➜  frontend-digitaal-loket git:(chore/ember-4.12-lts-update) ✗ npm list ember-source && npm list ember-cli && npm list --pattern ember-data 
frontend-loket@0.84.1 /Users/windvis/Development/Projects/digitaal-loket/frontend-digitaal-loket
├─┬ @appuniversum/ember-appuniversum@2.6.0
│ └── ember-source@4.12.3 deduped
├─┬ @ember/test-helpers@2.9.3
│ ├─┬ @embroider/util@1.9.0 overridden
│ │ └── ember-source@4.12.3 deduped
│ └── ember-source@4.12.3 deduped
├─┬ @lblod/ember-rdfa-editor@3.5.0
│ ├─┬ @ember/render-modifiers@2.0.5
│ │ └── ember-source@4.12.3 deduped
│ └─┬ ember-velcro@1.1.0
│   └─┬ ember-functions-as-helper-polyfill@2.1.2
│     └── ember-source@4.12.3 deduped
├─┬ ember-cli-app-version@6.0.1
│ └── ember-source@4.12.3 deduped
├─┬ ember-data@4.12.3
│ └─┬ @ember-data/model@4.12.3
│   └─┬ ember-cached-decorator-polyfill@1.0.2
│     └── ember-source@4.12.3 deduped
├─┬ ember-power-select@6.0.1
│ └─┬ ember-basic-dropdown@6.0.2
│   └─┬ ember-element-helper@0.6.1
│     └── ember-source@4.12.3 deduped
├─┬ ember-qunit@6.2.0
│ └── ember-source@4.12.3 deduped
├─┬ ember-resolver@10.1.1
│ └── ember-source@4.12.3 deduped
└── ember-source@4.12.3

frontend-loket@0.84.1 /Users/windvis/Development/Projects/digitaal-loket/frontend-digitaal-loket
├─┬ ember-cli-dependency-checker@3.3.1
│ └── ember-cli@4.12.2 deduped
└── ember-cli@4.12.2

frontend-loket@0.84.1 /Users/windvis/Development/Projects/digitaal-loket/frontend-digitaal-loket
├─┬ @lblod/ember-submission-form-fields@2.11.0
│ └── ember-data@4.12.3 deduped
└── ember-data@4.12.
@runspired
Copy link
Contributor

I suspect this is roughly the root cause of #7113 which I stumbled into many eons ago and then couldn't reproduce.

@runspired
Copy link
Contributor

Fixed in #8791 which will be backported to 4.12 as well. Unlikely 4.8 sees a fix for this, though open to attempting to backport there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants