-
Notifications
You must be signed in to change notification settings - Fork 745
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
Delete resource from everywhere when force_delete is selected #12680
Delete resource from everywhere when force_delete is selected #12680
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the issue is fixable with only the fix to the validator class, then we should avoid adding additional untested code to the command itself. I think that if the force-deletion isn't applied even when the data is successfully passed from front-end through to the creation of the task, then the additional code will be necessary.
if node_ids and force_delete: | ||
# As we are deleting similar nodes from everywhere | ||
# We need to find the node_ids of all the similar nodes that are not passed from the frontend | ||
# So we will find the content_ids of the nodes that are passed from the frontend and | ||
# then find the node_ids of the nodes that have the same content_id(as content_id is common for all smilar nodes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious if maybe this addition isn't necessary - could you try testing it with these changes not applied?
I suspect that the validate method being fixed, which ensures that force_delete
is passed to the task, then the feature should work as it did before. I mainly suspect this because it is a feature that used to work but no longer does.
I haven't looked at it closely, but I'd guess that delete_metadata
uses the force_delete
to the expected effect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That force_delete is behaving differently than my logic here. It deletes the entire channel when a single resource is force_deleted.
See In my Imported Channel
. I have some content titled Sample Video
that is present in both Topic 1
and Imported
Folder(They share the same content_id):
So if we force_deleted the Sample Video, only that should have been deleted from both folders. But the entire channel gets deleted:
Screencast from 26-09-24 11:31:00 AM IST.webm
Note: This is only with the changes to DeleteChannelValidator without my change in the deletecontent command. Even with my changes, the behavior remains the same. I
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thesujai thank you for that and apologies for my delay in responding here.
We've stumbled upon a chain of bugs... 😅
This all started when I found that the checkbox to select "force_delete" had a bug, which then led you here to find the bug in the DeleteChannelValidator#validate
method, which also led you to find that there is a bug with how we're handling granular deletion as well.
I was expecting the scope of this issue to be more along the lines of what the validator updates fix: the user's selection is passed along to the queuing of the deletion task.
Let's get that fix merged in this PR and fixing the deletion issue itself can be done in a follow-up issue (which you're welcome to take on if you're interested).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reverted! I can try fixing this behavior in a follow-up
Build Artifacts
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's get the changes to deletecontent
reverted here and just merge the fix to the validator - despite now knowing that there is something weird going on when things are actually deleted.
I will make a follow-up issue for that particular problem.
if node_ids and force_delete: | ||
# As we are deleting similar nodes from everywhere | ||
# We need to find the node_ids of all the similar nodes that are not passed from the frontend | ||
# So we will find the content_ids of the nodes that are passed from the frontend and | ||
# then find the node_ids of the nodes that have the same content_id(as content_id is common for all smilar nodes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thesujai thank you for that and apologies for my delay in responding here.
We've stumbled upon a chain of bugs... 😅
This all started when I found that the checkbox to select "force_delete" had a bug, which then led you here to find the bug in the DeleteChannelValidator#validate
method, which also led you to find that there is a bug with how we're handling granular deletion as well.
I was expecting the scope of this issue to be more along the lines of what the validator updates fix: the user's selection is passed along to the queuing of the deletion task.
Let's get that fix merged in this PR and fixing the deletion issue itself can be done in a follow-up issue (which you're welcome to take on if you're interested).
7800af0
to
abf7925
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
abf7925
to
43df183
Compare
Just did a quick retarget and rebase, as this is aimed at 0.17 planned patch 2. Will merge once the build completes. |
Summary
References
Fixes #12606
Reviewer guidance
Try and replicate this, if it doesn't replicate then we are good to go.
Testing checklist
PR process
Reviewer checklist
yarn
andpip
)