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

Fixes #772 Instance target bug #778

Merged
merged 4 commits into from
Jan 8, 2016
Merged

Conversation

kecso
Copy link
Member

@kecso kecso commented Jan 7, 2016

The commits should be cherry-picked into the master as well.

With the new export/import approach, we do not export instances that has no additional info to their bases, and because of this we can lose pointer target information.
We introduced a combined id (guidOfTheRootOfInstantiation@relativePath) that can be used during the import to successfully recreate such relations.
@kecso kecso added this to the v1.4.0 milestone Jan 7, 2016
@kecso kecso modified the milestones: v1.3.2, v1.4.0 Jan 7, 2016
@@ -1031,6 +1061,8 @@ define(['common/util/assert', 'blob/BlobConfig'], function (ASSERT, BlobConfig)
core.setPointer(node, keys[i], null);
} else if (nodes[target] && toRemoveGuids.indexOf(target) === -1) {
core.setPointer(node, keys[i], nodes[target]);
} else if (isCombinedId(target)) {
core.setPointer(node, keys[i], getCombinedTarget(target));
} else {
console.log('error handling needed???!!!???');
Copy link
Contributor

Choose a reason for hiding this comment

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

How about bringing in that logger and/or throwing an exception here?

Copy link
Member Author

Choose a reason for hiding this comment

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

I was checking the logger, but either the public API should be changed, or some global logger should be created.
On the other hand the given else branch is considered (again) a never run into branch, that is why I left it that way.

Copy link
Contributor

Choose a reason for hiding this comment

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

How about throwing an exception?
It was probably meant not to be entered before either but it did.
Now if someone imports and doesn't pay attention to the logs they might end up with an incomplete model

@pmeijer
Copy link
Contributor

pmeijer commented Jan 8, 2016

Looks good besides two minor notes. Coverage looks good too.

pmeijer pushed a commit that referenced this pull request Jan 8, 2016
@pmeijer pmeijer merged commit b154370 into v1.3.x Jan 8, 2016
@hakantunc
Copy link
Member

Thanks a bunch

@pmeijer pmeijer deleted the issue/772_instance_target_bug branch January 9, 2016 12:19
@pmeijer pmeijer mentioned this pull request Jan 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants