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

Assert when ManyArray.objectAt after one of the records has been unloaded #4758

Closed
hjdivad opened this issue Jan 16, 2017 · 4 comments
Closed

Comments

@hjdivad
Copy link
Member

hjdivad commented Jan 16, 2017

Although it would be nice for this to work, we do not support sparse arrays. It would probably be better to error rather than to have undefined behaviour (as we have today).

However, it is likely better as a first step to just warn, and then to see how pervasive the warning becomes, especially in test teardown.

@mixonic
Copy link
Member

mixonic commented Mar 30, 2017

Fixed in #4896

@mixonic mixonic closed this as completed Mar 30, 2017
@runspired
Copy link
Contributor

Additional fix in #4912

@stefanpenner stefanpenner reopened this Apr 5, 2017
@stefanpenner
Copy link
Member

stefanpenner commented Apr 5, 2017

#4896 does not appear fix this issue, I believe #4896 is actually performing the wrong check. Out of bounds access does not signify an unloaded record, rather it is just out of bounds access and should return undefined (no warning).

Rather the check here should be internalModel !== undefined && internalModel.someFlagSayingIsHasBeenUnloadedAndIForgotTheName

@stefanpenner
Copy link
Member

stefanpenner commented Apr 5, 2017

After chatting with @hjdivad we feel this is actually no longer as issue. If a relationship has a member that is unloaded, the entire relationship has also been dematerialized and must be refetched anyways.

pairing with @hjdivad

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

4 participants