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

Helper "not" has wrong value when passing PromiseProxy #108

Open
nag5000 opened this issue Jan 28, 2020 · 0 comments
Open

Helper "not" has wrong value when passing PromiseProxy #108

nag5000 opened this issue Jan 28, 2020 · 0 comments

Comments

@nag5000
Copy link

nag5000 commented Jan 28, 2020

This bug actually related to all truthConvert-helpers.
Initially, I reproduced this bug with an ember-data model (async belongsTo relationship), but it can be reproduced on any Ember.ProxyMixin based object.

What's going on here:

  1. I have an ember-data model in loading state (isPending == true)
  2. {{not model}} returns true (offtopic: isn't that weird already? model != null, so I expect false as result of {{not model}}). OK, it returns true because truthConvert checks isTruthy and model.isTruthy === false until it is fulfilled.
  3. After some time, the model is loaded. model.isTruthy becomes true, model.isSettled === true.
  4. {{not model}} is not recomputed, it still returns true (expected false).

Ember: 3.4.8
Ember Data: 3.4.4
ember-truth-helpers: 2.1.0

Demo: https://ember-twiddle.com/1dd51cbbc7e12f94e255913ef279baec?openFiles=controllers.application.js%2C

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

1 participant