Let a storage backend refuse or defer a deletion, with a reason shown to the user
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 25/100
Piste de recherche
The proposal identifies AmazonS3::unlink() and S3ObjectTrait::deleteObject() in Nextcloud storage, along with WebDAV deletion and trash emptying, but does not name file paths or tests. Start by tracing those deletion entry points and the current refusal handling; the scope spans a typed refusal, user-visible messages, deletion events, and S3 Object Lock behavior. Done means refused or deferred deletes preserve the item and explain why, while accepted deletes and S3 retention or legal holds are handled and covered by tests.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
[!TIP]
Help move this idea forward
- Use the 👍 reaction to show support for this feature.
- Avoid commenting unless you have relevant information to add; unnecessary comments create noise for subscribers.
- Subscribe to receive notifications about status changes and new comments.
Is your feature request related to a problem? Please describe.
Public bodies must keep records for their full statutory retention period, and may only destroy them through a recorded decision. A record under legal hold may not be destroyed at all. The natural setup for this is Nextcloud on top of storage that enforces retention, such as an S3 bucket with Object Lock. Today the two cannot talk to each other:
- Deletion is an unconditional instruction. A backend has no way to answer "not yet, and here is why".
- On S3 it is worse than an error.
AmazonS3::unlink()(files_external) andS3ObjectTrait::deleteObject()(primary object storage) sendDeleteObjectwithout aVersionId. Object Lock requires versioning, so S3 answers with a delete marker and reports success. The file disappears for the user and from Nextcloud, while the locked bytes stay in the bucket out of sight. Folder deletes usedeleteObjectswithQuiet: trueand do not read back the per-key errors. - When a deletion is refused today (a listener throws
AbortedEventException, or the storage returnsfalse), WebDAV answers a bare 403 and the reason is lost.
We found this by reading the code on master; we are confirming it on MinIO with Object Lock and will add the results here.
Describe the solution you'd like
- A typed refusal. A storage or listener can throw a refusal carrying a reason for the user and, optionally, the date until which the object is held. WebDAV returns it with the message, and Files shows it, also when emptying the trash.
- Permanent deletion as a request. Emptying the trash asks the backend, and the backend may refuse or defer. A refused item stays where it is.
- Events for both a refused and a completed deletion, carrying the file's identity, so audit logging can record both.
- S3 storages that respect Object Lock: recognise retention and legal hold and report them as a refusal instead of writing a delete marker, and check a folder before deleting it so it is never left half deleted.
Core keeps no retention rules. Which object is kept for how long belongs to the backend or to apps; core only understands the answer and shows it.
Describe alternatives you've considered
- files_retention. Despite the name it solves the opposite half: it deletes tagged files after a period, and nothing stops a user from deleting them earlier. Records need protection until the end date first, and only then destruction with a recorded decision. files_retention would benefit from this proposal: its background job calls
Node::delete(), so it would get a clear "not yet" back instead of silently creating a delete marker on S3. - App-level protection, such as a listener on
BeforeNodeDeletedEvent. It does not hold for records: an admin can disable the app, other code paths bypass it, and it cannot protect against direct access to the bucket. Only the storage layer can enforce retention; core needs to understand its answer.
Additional context
This is one of a small set of storage interface extensions for records-managed backends, together with backend metadata (#66355) and durable object identity (#66499). We (Conduction, working with Dutch municipalities and VNG Common Ground) would like to build and maintain the pull requests, with tests and a MinIO Object Lock test setup.
- Langage dominant
- PHP
- Étoiles
- 37.5k
- Forks
- 5.4k
- Merge moyen
- 1 j 13 h
- PR mergées (30 j)
- 639
Préparer son environnement
Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de nextcloud/server
-
35-feedback
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
0. Needs triage 35-feedback bug
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100
Les mainteneurs répondent en général sous 1 jour
-
workflowengine: File entity reuses the node of the first "Tag assigned" event for all later events in the same processPeut-être pris @lazerg l’a pris il y a 2 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
Les mainteneurs répondent en général sous 1 jour
-
Contacts import aborts with TypeError when vCards have no UID (TextImporter structure)Peut-être pris @SebastianKrupinski l’a pris il y a 6 jours. Ouvertebug
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
nextcloud/server#66486 · 2 commentaires · 2 réactions · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
Unified search: screen reader hears "No matching results" on mobile even when there are resultsPeut-être pris @lazerg l’a pris il y a 10 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de nextcloud/server
Issues similaires
-
[Sync EN] stream: document the errors of the stream_context_*() and stream filter functions (#6091)Ouvertesync-en
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 79/100
Automattic/blocks-engine#6318 ·
Les mainteneurs répondent en général sous 1 jour
-
Update: Laravel Cheat Sheet - middleware examples for the bootstrap/app.php layout (small update)Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
OWASP/CheatSheetSeries#2990 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 1-3 heures Accessibilité débutants 82/100
Les mainteneurs répondent en général sous 1 jour