Skip to content

Deleting user must delete all their tags #12816

Closed

Description

@PVince81

Steps

  1. Create user
  2. Create/assign tags for this user (for example using the contacts app or favorites feature Add favorites to files app #12360)
  3. Delete user
  4. Check table oc_vcategory

Expected result

User tags are deleted

Actual result

User tags are still there

Versions

master 4b57892

Activity

  1. self-assigned this
    on Dec 12, 2014
  2. PVince81 commented on Dec 12, 2014

    @PVince81
    ContributorAuthor

    Not sure how to proceed here. Normally I'd register a hook for deleteUser and delete the tags.
    I'm not clear about where to put that code as this has to be done in core.

    Making the TagManager listen to that hook will not work because it implies having it initialized (currently it's lazy-inited in the server container).
    Making the files app register the hook doesn't make sense, as this applies to any tag, not only files tags.
    Should I add this in gasp base.php ?
    Or is there a better location ? Maybe the user manager ?

    @icewind1991 @blizzz @schiesbn any idea where to register the hook ?

  3. PVince81 commented on Dec 12, 2014

    @PVince81
    ContributorAuthor

    Started a PR here: #12821

  4. added this to the milestone on Dec 15, 2014
  5. MorrisJobke commented on Jan 5, 2015

    @MorrisJobke
    Contributor

    @PVince81 As a first step you could add a command to cleanup the tags ;) There you can invoke the logic and then decide after the release where and how to register the hooks properly ;)

  6. PVince81 commented on Jan 14, 2015

    @PVince81
    ContributorAuthor

    Raised repair step ticket here: #13334
    That would be the bare minimum to avoid too much DB pollution in the long run.

  7. MorrisJobke commented on Jan 14, 2015

    @MorrisJobke
    Contributor

    The repair step is now merged

  8. blizzz commented on Jan 15, 2015

    @blizzz
    Contributor

    On which conditions will it be lazy-initialized?

  9. PVince81 commented on Jan 15, 2015

    @PVince81
    ContributorAuthor

    The repair step is just a workaround for now.
    @nickvergessen suggested to have it run as a background job.

  10. PVince81 commented on Jan 19, 2015

    @PVince81
    ContributorAuthor

    Not a showstopper, moving to 8.1.

    @nickvergessen suggested to make it a one-shot background job: as soon as a user is deleted, the bkg job for cleanup is created. This way the user deletion isn't delayed. Same could be done for other cleanup tasks.

  11. modified the milestones: , on Jan 19, 2015
  12. PVince81 commented on Jan 19, 2015

    @PVince81
    ContributorAuthor

    Oh, look what I just found: https://github.com/owncloud/core/blob/master/lib/public/itags.php#L34

    It looks like tag deletion whenever a user is deleted was already implemented...

  13. DeepDiver1975 commented on Jan 19, 2015

    @DeepDiver1975
    Contributor

    Oh, look what I just found: https://github.com/owncloud/core/blob/master/lib/public/itags.php#L34

    It looks like tag deletion whenever a user is deleted was already implemented...

    but the location is rater sub optimal .... we need that on IRC discussed hook manager ...

  14. 5 remaining items

  15. removed this from the milestone on Mar 3, 2015
  16. modified the milestones: backlog, on Jul 3, 2015
  17. MorrisJobke commented on Oct 29, 2015

    @MorrisJobke
    Contributor

    #13477

    This was merged to 8.2 #18316

  18. PVince81 commented on Jun 14, 2016

    @PVince81
    ContributorAuthor

    Would be better to extend CleanTags to delete the tags of deleted users instead.

  19. nickvergessen commented on Jun 14, 2016

    @nickvergessen
    Contributor

    I can take care of this.

  20. modified the milestones: , backlog on Jun 15, 2016
  21. phpweb commented on Mar 6, 2017

    @phpweb

    Version 9.1.4

    I created one user and I logged in as this newly created user and I uploaded an image and I assigned a tag. Later I logged out and logged in as Admin and I deleted this newly created user. Files and folders were deleted. The tag is but still there.

    In terminal I called the cron.php

    php -f cron.php

    This did not also delete the tag.

  22. PVince81 commented on Mar 7, 2017

    @PVince81
    ContributorAuthor

    You are likely talking about system tags which have no owners, the admin must delete these manually.

    The original ticket was about private tags which were only used by the contacts app.

  23. lock commented on Aug 2, 2019

    @lock

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  24. locked as resolved and limited conversation to collaborators on Aug 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions