nextcloud / nextcloud/server

[Bug]: After restore, opening file navigates to Deleted files (file not in trash)

Open
#62,277 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage 33-feedback bug feature: files feature: trashbin
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

⚠️ This issue respects the following points: ⚠️
Bug description

After restoring a file from Deleted files, the restore succeeds and the file is correctly placed back in Personal files. However, opening the restored file immediately afterwards causes the Files app to navigate back to Deleted files (breadcrumb such as Deleted files / Documents), even though the file no longer exists there.

In some cases, even newly uploaded files under Personal files subsequently open in the trash view until the page state is refreshed.

This appears to be a stale Files UI state (path, file id or navigation context) after restoring an item from the trash rather than a failed restore.

Steps to reproduce
  1. Create a folder (e.g. Documents) in Personal files.
  2. Upload a .docx file to that folder.
  3. Delete the folder.
  4. Open Deleted files.
  5. Restore the folder.
  6. Verify that the folder is back under Personal files.
  7. Open the restored .docx file.

Update: we disabled Full Text Search to rule it out:

  • files_fulltextsearch
  • fulltextsearch
  • fulltextsearch_elasticsearch

Behaviour is unchanged (restore still navigates to Deleted files when opening the file). So this does not appear related to FTS.

Also note: instance is on 33.0.0 (config above).

Expected behavior
  • After restoring a file or folder, opening the file should remain in Personal files.
  • The Files app should not navigate back to Deleted files once the item has been restored.
  • The breadcrumb and navigation context should reflect the restored location.
Nextcloud Server version

33

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.2

Web server

Apache (supported)

Database engine version

MariaDB

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

Upgraded to a MAJOR version (ex. 31 to 32)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?
  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other
Configuration report
{
    "system": {
        "config_is_read_only": false,
        "appstoreenabled": true,
        "trusted_domains": [
            "***REDACTED***"
        ],
        "forwarded_for_headers": [
            "HTTP_X_FORWARDED_FOR"
        ],
        "htaccess.RewriteBase": "\/",
        "default_phone_region": "NL",
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "overwrite.cli.url": "https:\/\/***REDACTED***",
        "proxy": "***REDACTED***",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "3306",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "mail_smtpmode": "sendmail",
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 16379,
            "ssl_context": {
                "local_cert": "***REDACTED***",
                "local_pk": "***REDACTED***",
                "cafile": "***REDACTED***",
                "verify_peer_name": true
            }
        },
        "log.condition": {
            "apps": [
                "admin_audit"
            ]
        },
        "log_type": "syslog",
        "logfile": "",
        "loglevel": 2,
        "syslog_tag": "Nextcloud",
        "log_type_audit": "syslog",
        "syslog_tag_audit": "Nextcloud-audit",
        "logfile_audit": "",
        "skeletondirectory": "\/data\/appdata_skeletondirectory",
        "theme": "",
        "simpleSignUpLink.shown": false,
        "maintenance": false,
        "version": "33.0.0.16",
        "maintenance_window_start": 1,
        "twofactor_enforced": "true",
        "twofactor_enforced_groups": [],
        "twofactor_enforced_excluded_groups": [],
        "enable_previews": false,
        "forbidden_filename_characters": [
            "?",
            "<",
            ">",
            ":",
            "*",
            "|",
            "\""
        ],
        "integrity.excluded.files": [
            ".htaccess",
            "resources\/config\/ca-bundle.crt"
        ],
        "proxyexclude": [
            "***REDACTED***",
            "***REDACTED***"
        ],
        "overwriteprotocol": "https",
        "serverid": 1,
        "server_id": 1
    }
}
List of activated Apps
Enabled:
  - activity: 6.0.0-dev.0
  - admin_audit: 1.23.0
  - app_api: 33.0.0
  - bruteforcesettings: 6.0.0-dev.0
  - calendar: 6.2.1
  - circles: 33.0.0
  - cloud_federation_api: 1.17.0
  - comments: 1.23.0
  - contacts: 8.4.0
  - contactsinteraction: 1.14.1
  - dashboard: 7.13.0
  - dav: 1.36.0
  - drawio: 4.2.3
  - federatedfilesharing: 1.23.0
  - federation: 1.23.0
  - files: 2.5.0
  - files_downloadlimit: 5.1.0-dev.0
  - files_fulltextsearch: 33.0.0
  - files_pdfviewer: 6.0.0-dev.0
  - files_reminders: 1.6.0
  - files_sharing: 1.25.2
  - files_trashbin: 1.23.0
  - files_versions: 1.26.0
  - firstrunwizard: 6.0.0-dev.0
  - fulltextsearch: 33.0.0
  - fulltextsearch_elasticsearch: 33.0.0
  - group_everyone: 0.1.19
  - groupfolders: 21.0.6
  - lookup_server_connector: 1.21.0
  - nextcloud_announcements: 5.0.0
  - notes: 4.13.0
  - notifications: 6.0.0
  - oauth2: 1.21.0
  - password_policy: 5.0.0-dev.0
  - privacy: 5.0.0-dev.0
  - profile: 1.2.0
  - provisioning_api: 1.23.0
  - recommendations: 6.0.0-dev.0
  - related_resources: 4.0.0-dev.0
  - richdocuments: 10.1.0
  - serverinfo: 5.0.0-dev.0
  - settings: 1.16.0
  - sharebymail: 1.23.0
  - support: 5.0.0
  - survey_client: 5.0.0-dev.0
  - systemtags: 1.23.0
  - text: 7.0.0-dev.3
  - theming: 2.8.0
  - twofactor_backupcodes: 1.22.0
  - twofactor_totp: 15.0.0-dev.0
  - user_status: 1.13.0
  - viewer: 6.0.0-dev.0
  - weather_status: 1.13.0
  - webhook_listeners: 1.5.0
  - workflowengine: 2.15.0
Disabled:
  - encryption: 2.21.0
  - files_antivirus: 6.1.0 (installed 6.0.7)
  - files_external: 1.25.1
  - logreader: 6.0.0 (installed 2.14.0)
  - photos: 6.0.0-dev.0 (installed 2.4.0)
  - suspicious_login: 11.0.0-dev.0
  - twofactor_nextcloud_notification: 7.0.0
  - updatenotification: 1.23.0 (installed 1.23.0)
  - user_ldap: 1.24.0
Nextcloud Signing status

Nextcloud Logs

Additional info
  • Upgraded to NC 33 some time ago; noticed only recently
  • Related to #58233 (Unknown / A long time ago in Deleted files)
  • Extra: after restore, opening file from Personal files navigates to Deleted files view though file is no longer in trash
  • Also: upload new file → open → lands in trash view (file not there)
  • Storage: CIFS datadir, 2 app nodes, Redis (APCu+Redis)
  • Browser: <Chrome/Firefox + version>

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the restore flow in the Files app: restore a folder from Deleted files, open its file, then try opening a newly uploaded file without refreshing. Trace the navigation state, path, and file context after restore; done means restored and newly uploaded files open in Personal files with the correct breadcrumb, without disabling full-text search.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, php
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.