-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[3.28->4.7] isLoaded
does not recompute if checked before the record has loaded.
#9232
Comments
This has mainly been added to visibility for anyone else that has this issue, the work around i have been using is to check isFulfilled, but this is not a strict like for like as it requires you to check a promise and doesn't take into account the value being null. |
isLoaded
does not recompute if checked before the record has loaded.isLoaded
does not recompute if checked before the record has loaded.
am open to this being fixed for 3.28/4.4 if anyone still using those versions (ahem model-fragments users) wants to contribute a fix. |
Im happy to write a fix, but not 100% sure what the best solution would be, in my mind it would be notifying all the related properties instead of just
|
@Mikek2252 You suggest this is fixed in 4.8, however, the code in RecordState didn't evolve much between 4.7 and main. I suspect what changed is the |
@runspired So i just had a look at it again and it looks like i made a small mistake, it looks like this was fixed in 4.7 |
Soo playing around with 4.7 and 4.6 it looks like |
Reproduction
Please provide one of the following:
This branch has a reproduction, all that is requires is to access a model through realtionship and check
isLoaded
before it has Loaded. After the request has finished the record will be stuck in an empty state, this is also because isEmpty also does not recompute.(https://github.com/Mikek2252/ember-new-output/tree/ember-data-bug)
Description
If
isLoaded
is checked on a model that hasn't loaded such as a relationshipfoo.bar.isLoaded
then you checkfoo.bar.isLoaded
after the record has loaded it will not recomputeisLoaded
and also the state of that record will be set toroot.empty
Versions
This occurs on ember-data 3.28 -> 4.7 (it is fixed in 4.8)
The text was updated successfully, but these errors were encountered: