- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Dangling relationships after removing a working copy #77
Comments
I just came across this exact issue and indeed my suggestion was going to be to modify get_checkout_relation to return the first non-broken relation instead of just assuming the first item is the intended one. Even if this package handles garbage collection better it's probably worth explicitly doing this check for any edge cases. |
@ewohnlich Well, there are 2 things with that solution:
At this point, you are at the same place you were in step "a" but the catalog is in a different state, where a broken relationship exists... I have been tied up with other things and wasn't able to finish my PR here #78 I hope to be able to do so this weekend... And, btw, if you want to help me over there, you are welcome :) |
The strange thing to me is that this behavior seemed to be working in a previous version of Plone. We came across a bug where if the user deleted a wc, instead of canceling the checkout, it would cause this problem. But canceling the checkout worked as expected, so the solution was to add an event listener on deletion to call |
@ewohnlich yup, you even opened a bug 2 years ago about it #63 we also fixed that by implementing the same event subscriber... I will try to fix that too in this package in another PR |
@frapell can you explain why you think |
@ewohnlich Yes, that's correct, if you check my fix in https://github.com/plone/plone.app.iterate/pull/78/files you'll see that there are 2 places where this needs to be addressed, on cancelling a checkout and on checking in... in both cases the working copy is deleted, and so the relationship should no longer exist... There are some possible edge cases as Maurits mentioned in #78 (comment) that needs to be tested, in order to validate there are no side effects by removing the relationship, instead of marking it as broken |
An issue exists in this product, so when you either cancel a check-out or do a check-in, the relationship between the baseline and the working copy is not removed, but instead flagged as "broken". I am not sure what was the rationale behind this implementation but it results in a broken functionality:
Baseline

Working Copy

Baseline

Working Copy

The reason for this is because the relationship between them, instead of being removed, is marked as "broken"
plone.app.iterate/plone/app/iterate/dexterity/copier.py
Lines 113 to 117 in 6c7af3b
Then, when the viewlet tries to find the relationship at
plone.app.iterate/plone/app/iterate/dexterity/utils.py
Lines 30 to 35 in 6c7af3b
I guess one way of fixing this would be to change that
get_checkout_relation
so it will iterate over all relationships and at least return the first one that is not broken, however I do not see the reason nor the value on keeping relationships in a broken state, so I think the proper way to fix it is to actually remove the relationship from the catalog altogether.The text was updated successfully, but these errors were encountered: