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

[BUGFIX release] unloadRecord + findRecord + orphaned relationships #5102

Merged

Conversation

stefanpenner
Copy link
Member

Given unloadRecord followed by a synchronous findRecord, we should be sure
any orphaned relationships are discarded.

Copy link
Member

@hjdivad hjdivad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

if (this.isDestroyed || this.isDestroying) { return; }

// just in-case we are not one of the orphaned, we should still
// still destroy outselves
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: outselves -> ourselves

@@ -1128,14 +1128,13 @@ Store = Service.extend({
let internalModel = this._internalModelsFor(modelName).get(trueId);

if (!internalModel) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally we can refactor this to avoid if (! with an else clause (and instead flipping the blocks around to remove the !). Definitely fine for a follow up PR though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nah i can doit as part of this one.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thank you. It is much easier for me to read this way.

@stefanpenner stefanpenner force-pushed the unload-with-orphaned-relationships-and-sync-find branch from ce34582 to b9f79ab Compare July 29, 2017 04:43
Given unloadRecord followed by a synchronous findRecord, we should be sure
any orphaned relationships are discarded.
@stefanpenner stefanpenner force-pushed the unload-with-orphaned-relationships-and-sync-find branch from b9f79ab to 27c58e5 Compare July 29, 2017 19:06
@stefanpenner stefanpenner merged commit 367a0d6 into release Jul 29, 2017
@stefanpenner stefanpenner deleted the unload-with-orphaned-relationships-and-sync-find branch July 29, 2017 19:54
@stefanpenner
Copy link
Member Author

released as v2.14.9

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.

3 participants