Closed runspired closed 1 year ago
We improved the behavior here slightly by only considering missing relationship data to be empty when no previous information has been received: https://github.com/emberjs/data/pull/5880
Would still love a champion for this deprecation so we can help folks avoid bugs when their payloads are less complete than they should be.
I'm closing this due to inactivity. This doesn't mean that the idea present here is invalid, but that, unfortunately, nobody has taken the effort to spearhead it and bring it to completion. Please feel free to advocate for it if you believe that this is still worth pursuing. Thanks!
This is still pretty important as it's one of our more serious misalignments between spec's and what we do. It's also low hanging fruit :)
closing in favor of https://github.com/emberjs/data/issues/7584
Currently, if a synchronous relationship receives a payload containing no information about it's state, we initialize the relationship as if it were canonically empty. This is incorrect, as we don't actually know the state (having received no information about it), which leads to us being unable to utilize
reference.load()
which would otherwise allow a user to utilizefindBelongsTo
/findHasMany
to load the relationship manually. While users of references may usereference.reload()
instead, we should also firm up our API expectations here, as this is a place wherein we deviate from json-api.This deprecation would warn when this scenario is encountered. Once the deprecation lifecycle is complete, this deprecation would turn into an assertion, as the relationship is in an invalid state. For additional context, see this bugfix commit that restored this behavior after it was unintentionally broken/discovered: https://github.com/emberjs/data/pull/5533/commits/850bdf2688fe9e9cbfb4f381cb9d460acf7150f7