Skip to content

{master} Unload fun - #5094

Merged
stefanpenner merged 3 commits into
masterfrom
unload-fun
Jul 25, 2017
Merged

{master} Unload fun#5094
stefanpenner merged 3 commits into
masterfrom
unload-fun

Conversation

@stefanpenner

Copy link
Copy Markdown
Contributor

No description provided.

stefanpenner and others added 3 commits July 25, 2017 11:52
…rd()

For an async relationship [x, y] with x.unloadRecord(), now adjusts only
the relationship’s currentState, leaving that relationship’s canonical
state alone, ensuring the existing client-side delete semantics are
preserved. But when that relationship is reloaded, the canonicalState
consulted.

For sync relationship [x, y] with x.unloadRecord(), both currentState
and canonical state are updated. This is to mirror the client-side
delete semantics. But since we cannot reload a sync relationship we must
assume this to be the new canonical state and rely on subsequent `push`
or `adapterPayloads` or manual `store.push` to update.

This aims to:

* [FIX] hasMany arrays never contain dematerialized records (so they no longer become broken)
* [FIX] using unloadRecord as a type of client side delete is restored
* [PRESERVE] the garbage collector pass to cleanup orphaned models
* [PRESERVE] second access to a relationship which did contain an unloadRecord to cause a reload

note: if both sides of a relationships are unloaded, the above doesn’t
apply. This is largely just when members of a loaded relationship are
themselves unloaded.

[fixes #4986 #5052 #4987 #4996]
@stefanpenner stefanpenner changed the title {masterr} Unload fun {master} Unload fun Jul 25, 2017
@stefanpenner
stefanpenner merged commit 71dc584 into master Jul 25, 2017
@stefanpenner
stefanpenner deleted the unload-fun branch July 25, 2017 23:11
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

Successfully merging this pull request may close these issues.

2 participants