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

[Bug]: Cannot remove favorite folder #49395

Open
5 of 8 tasks
valentinthedon opened this issue Nov 20, 2024 · 4 comments
Open
5 of 8 tasks

[Bug]: Cannot remove favorite folder #49395

valentinthedon opened this issue Nov 20, 2024 · 4 comments

Comments

@valentinthedon
Copy link

valentinthedon commented Nov 20, 2024

⚠️ This issue respects the following points: ⚠️

Bug description

I can't remove folders from favorite. They are delete from the favorite section, but they still keep the star on the icon and i still can remove from favorite

Steps to reproduce

  1. Add folder to favorites
  2. Select then remove folder from favorites
  3. Reload the page
  4. Favorite section is empty but in all file, favorite still appear as favorite

Expected behavior

The folder are remove from favorite and the icon is up to date

Nextcloud Server version

30

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.2

Web server

Nginx

Database engine version

PostgreSQL

Is this bug present after an update or on a fresh install?

None

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "cloud.inspemon.com"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "skeletondirectory": "",
        "templatedirectory": "",
        "version": "30.0.2.2",
        "overwrite.cli.url": "https:\/\/cloud.inspemon.com",
        "dbtype": "pgsql",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "maintenance_window_start": 1,
        "default_language": "fr",
        "default_locale": "fr_FR",
        "default_phone_region": "FR",
        "default_timezone": "Europe\/Paris",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379,
            "user": "default",
            "password": "***REMOVED SENSITIVE VALUE***",
            "dbindex": 0,
            "timeout": 1.5,
            "read_timeout": 1.5
        },
        "installed": true,
        "maintenance": false,
        "mail_smtpmode": "smtp",
        "mail_smtpsecure": "ssl",
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauth": 1,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "app.mail.attachment-size-limit": 10485760,
        "app.mail.background-sync-interval": 300,
        "forbidden_filename_characters": [
            "\\",
            "\/"
        ],
        "forbidden_filename_extensions": [
            ".filepart",
            ".part"
        ],
        "defaultapp": ""
    }
}

List of activated Apps

Enabled:
  - activity: 3.0.0
  - admin_audit: 1.20.0
  - app_api: 4.0.0
  - bruteforcesettings: 3.0.0
  - calendar: 5.0.1
  - circles: 30.0.0
  - cloud_federation_api: 1.13.0
  - comments: 1.20.1
  - contacts: 6.1.1
  - contactsinteraction: 1.11.0
  - dashboard: 7.10.0
  - dav: 1.31.1
  - deck: 1.14.2
  - drawio: 3.0.3
  - external: 5.5.2
  - federatedfilesharing: 1.20.0
  - files: 2.2.0
  - files_downloadlimit: 3.0.0
  - files_pdfviewer: 3.0.0
  - files_reminders: 1.3.0
  - files_sharing: 1.22.0
  - files_trashbin: 1.20.1
  - files_versions: 1.23.0
  - logreader: 3.0.0
  - lookup_server_connector: 1.18.0
  - mail: 4.0.3
  - notifications: 3.0.0
  - oauth2: 1.18.1
  - password_policy: 2.0.0
  - privacy: 2.0.0
  - provisioning_api: 1.20.0
  - recommendations: 3.0.0
  - related_resources: 1.5.0
  - serverinfo: 2.0.0
  - settings: 1.13.0
  - sharebymail: 1.20.0
  - spreed: 20.0.2
  - support: 2.0.0
  - systemtags: 1.20.0
  - theming: 2.5.0
  - theming_customcss: 1.17.0
  - twofactor_backupcodes: 1.19.0
  - updatenotification: 1.20.0
  - user_status: 1.10.0
  - viewer: 3.0.0
  - weather_status: 1.10.0
  - webhook_listeners: 1.1.0-dev
  - workflowengine: 2.12.0

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

No log

Additional info

Name of folder are masked for confidentiality.

You can see these folder are still marked as favorite but there are no favorites (no dropdown arrow in favorite section) even if i reload the page

Image

@valentinthedon valentinthedon added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Nov 20, 2024
@skjnldsv
Copy link
Member

Hey! Nice bug you found 👍
Do you have access to the database?

@kesselb
Copy link
Contributor

kesselb commented Nov 20, 2024

I'm working on a similar case for a customer.

How to reproduce:

  • Delete the favorite tag from oc_vcategory
  • Select 2 or more files
  • 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

@valentinthedon
Copy link
Author

valentinthedon commented Nov 20, 2024

Hey! Nice bug you found 👍 Do you have access to the database?

Yes i have access to the database, I have the same thing as @kesselb in my database. By the way I confirm that the bug appear when I select 2 folders and also the bug does not reproduce once it is done.

After a quick investigation, I remark that after adding in batch some folders in favorites, when i try to remove them from the favorites, only one is removed in table oc_vcategory_to_object (i.e. the link between file and category ), but no line or delete in oc_vcategory (the category)

However, it can be better to keep only one line in oc_vcategory and to link all files or folder with this line in oc_vcategory_to_object.

@joshtrichards joshtrichards added 1. to develop Accepted and waiting to be taken care of feature: files and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Nov 20, 2024
@kesselb
Copy link
Contributor

kesselb commented Nov 20, 2024

After a quick investigation, I remark that after adding in batch some folders in favorites, when i try to remove them from the favorites, only one is removed in table oc_vcategory_to_object (i.e. the link between file and category ), but no line or delete in oc_vcategory (the category)

Yep, because the relations are removed by the categoryid, but the current code does not consider that for one tag multiple categoryids can exist.

@skjnldsv skjnldsv added 2. developing Work in progress and removed 1. to develop Accepted and waiting to be taken care of labels Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants