-
Notifications
You must be signed in to change notification settings - Fork 24
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
await has issues with ember-data relationship promise proxies after 3.10 #54
Comments
@fivetanley I have a fix available locally. It changes the behavior to not diff the promise instance but use its resolved value instead. Would you be ok with merging this change? The change in ensureLatestPromise(promise, cb) {
cb.call(this, resolve(promise));
return this.valueBeforeSettled;
},
setValue(value) {
if (this.valueBeforeSettled !== value) {
this.valueBeforeSettled = value;
this.recompute();
}
} This will break edit: |
@makepanic Sorry for the late reply. That sounds great if you want to open a PR for this change! |
@makepanic / @fivetanley I'm running into this issue as well with v.2.0.0 of ember-promise-helpers, v.3.28 of ember, and v3.28 of ember-data. I can reproduce my use-case by updating one of the tests in
|
I've pushed a PR w/ a test to fix this. |
Hi, thanks for this great addon.
I've upgraded our apps to ember-data >3.10 and found that the
await
helper stopped working when relationships change.example construct:
If the
rel
relationship onmodel
changes, await doesn't set the new value.While debugging I found that the promise returned by e-d stays the same, but it's proxied value changes. The promise instance guid also stays the same.
Meaning the promise comparison will always return true:
https://github.com/fivetanley/ember-promise-helpers/blob/master/addon/helpers/await.js#L50
I'm unsure if this is a regression or some private api change in ember-data.
edit from discord:
The text was updated successfully, but these errors were encountered: