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

Prevent TypeInstance deletion when it's used by others #632

Closed
Tracked by #604
mszostok opened this issue Feb 13, 2022 · 2 comments · Fixed by #654
Closed
Tracked by #604

Prevent TypeInstance deletion when it's used by others #632

mszostok opened this issue Feb 13, 2022 · 2 comments · Fixed by #654
Assignees
Labels
area/hub Relates to Hub bug Something isn't working
Milestone

Comments

@mszostok
Copy link
Member

mszostok commented Feb 13, 2022

Description

Blocked by: #645

Prevent delete action when TypeInstance is used by others. Currently, we can delete TypeInstance without any notification that others are linked to it. In case of delegated storage proposal, this may break our flow as we won't be able to retrieve data for all linked TypeInstances.

Reason

Currently, we allow deleting TypeInstance that is used by others. Until now, it wasn't a big issue but after introducing delegated storage functionality, it will become more problematic as we use this relation to ask to resolve stored information.

Use cases

  • System User—ensure that it cannot break the TypeInstance resolution unconsciously.

Additional

It's a small piece of the rollback proposal: https://github.com/capactio/capact/blob/main/docs/proposal/20201209-action-rollback.md - rest logic will be handled by dedicated issue #502

@mszostok mszostok added enhancement New feature or request area/hub Relates to Hub labels Feb 13, 2022
@mszostok mszostok added this to the 0.7.0 milestone Feb 13, 2022
@mszostok mszostok added the needs-triage Relates to issues that should be refined label Feb 15, 2022
@mszostok mszostok removed the needs-triage Relates to issues that should be refined label Mar 1, 2022
@mszostok
Copy link
Member Author

mszostok commented Mar 1, 2022

Example:

                    // Check if a given TypeInstance is not used by others
                    CALL {
                        WITH ti
                        WITH ti
                        MATCH (ti)-[:USES]->(others:TypeInstance)
                        WITH count(others) as othersLen
                        RETURN  othersLen > 1 as isUsed
                    }
                    CALL apoc.util.validate(isUsed, apoc.convert.toJson({code: 400}), null)

@mszostok mszostok added bug Something isn't working and removed enhancement New feature or request labels Mar 6, 2022
mszostok added a commit to mszostok/capact that referenced this issue Mar 6, 2022
@mszostok
Copy link
Member Author

mszostok commented Mar 6, 2022

It turns out that it was implemented but there was a bug that is fixed by #654

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/hub Relates to Hub bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant