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

Only break circular dependencies at a soft dependency #91

Merged
merged 3 commits into from
Jul 9, 2021

Conversation

gasman
Copy link
Contributor

@gasman gasman commented Jul 6, 2021

Fixes #84. Where a circular dependency consists of a combination of soft and hard dependencies - for example, a grandchild page exists under a parent page (hard dependency) which exists under a grandparent page (hard dependency) which contains a rich text link to the grandchild page (soft dependency) - we can complete the import only by breaking the dependency chain at the soft dependency (i.e. omitting the rich text link). Previously, we were breaking the chain at the point where we discovered the circularity, which would fail if that was a hard dependency.

@gasman gasman requested a review from emilytoppm July 6, 2021 20:56
Copy link
Member

@emilytoppm emilytoppm left a comment

Choose a reason for hiding this comment

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

This looks good to me - we should definitely not be breaking hard dependencies if there are soft ones available. However, it feels like for circular dependencies, there is another desirable step: to re-import the affected fields after the circle is resolved and restore the links. Because at the end of the import process, we do still have the page being linked to, unlike the "outside the import tree" scenario. Breaking the link rather than failing is definitely better, but from a user's perspective, it's still hard to explain behaviour. What do you think?

@gasman
Copy link
Contributor Author

gasman commented Jul 8, 2021

Definitely - I think implementing that would be a much harder task, though.

@emilytoppm emilytoppm merged commit a77c564 into master Jul 9, 2021
@emilytoppm emilytoppm deleted the fix/grandchild-dependencies branch July 9, 2021 16:16
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.

KeyError on importing a page containing a reference to a grandchild page
2 participants