Skip to content

[Bug]: Incomplete handling for tags with the same name #54087

@kesselb

Description

@kesselb

Bug description

We received a report that some files marked as favorites are not displayed in the "Favorites" view. Additionally, users cannot remove the favorite state from these files. This issue is similar to #49395.

  • The lib/private/Tags.php implementation does not properly verify if a given tag already exists. Although a check exists, the list of tags is loaded only once and never updated.
  • The database table lacks a unique constraint, allowing multiple identical tags for the same user.

I've started working on patch: #49674

But adding that index on existing systems and ironing out the various issues I ran into while diving through the code needs more work, and therefore we would appreciate the files team taking over.

Steps to reproduce

  1. Delete the favorite tag from oc_vcategory
  2. Select 2 or more files
  3. Mark the files as favorite (as batch action)

The code in lib/private/Tags.php does not check if the given tag already exists properly. There's a check, but the list of tags is loaded only once and never updated. Also, there's no unique constraint on the table, and therefore it's a valid state to have the tag more than once for a user.

Image

Expected behavior

Tags with the same name should be handled gracefully.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions