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

Destroy talk media upon user deletion #651

Merged
merged 2 commits into from
Aug 13, 2024
Merged

Conversation

Splines
Copy link
Member

@Splines Splines commented Jun 17, 2024

Related to #647.

We noticed that destroying users by calling destroy directly (instead of calling the archive_and_destroy method) might result in invalid media as it has no editors anymore. From now on, we want to delete talk media of users when the respective user is destroyed under the following conditions:

  • If called from archive_and_destroy -> STOP and don't do anything
  • The user must not have any other media than talk media, e.g. the user must not have edited any lecture media.
    Otherwise -> STOP and don't do anything (*)
  • A talk medium is only deleted if the user is the sole editor of that medium. That is, if there are multiple editors, we will just ignore that specific talk medium and try to delete the next one.

(*) "Don't do anything" is just a safety measure. In the UserCleaner in #647, those users are considered to be non-generic, so we shouldn't call their destroy method in the first place.

Copy link

codecov bot commented Jun 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.90%. Comparing base (ed867fb) to head (eeebde2).

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #651      +/-   ##
==========================================
+ Coverage   66.64%   66.90%   +0.26%     
==========================================
  Files         309      310       +1     
  Lines        9386     9440      +54     
==========================================
+ Hits         6255     6316      +61     
+ Misses       3131     3124       -7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@fosterfarrell9 fosterfarrell9 left a comment

Choose a reason for hiding this comment

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

LGTM!

@Splines Splines merged commit 013cca2 into dev Aug 13, 2024
5 checks passed
@Splines Splines deleted the feature/user-destroy-media branch August 13, 2024 18:17
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.

2 participants