Repository navigation
feat(OCISDEV-944): migrate Delete to typed DeleteResult - #617
Merged
Merged
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
kobergj
requested changes
Jun 5, 2026
kobergj
left a comment
Collaborator
There was a problem hiding this comment.
Looks great 👍 Just minor remarks...
kobergj
reviewed
Jun 5, 2026
jvillafanez
reviewed
Jun 11, 2026
kobergj
previously approved these changes
Jun 11, 2026
LarsJurgensen
approved these changes
Jun 12, 2026
kobergj
approved these changes
Jun 12, 2026
dragonchaser
pushed a commit
to opencloud-eu/reva
that referenced
this pull request
Nov 11, 2026
FS.Delete now returns a DeleteResult with the space owner and the id of the deleted node. The storageprovider puts it into a context slot and the events middleware builds ItemTrashed from it, so the event carries the id of the trashed node even when the request referenced it by parent id and relative path. We keep our stat before deleting: it rejects deleting files that are still processing and puts the node id into the response opaque. For drivers that do not return a result ItemTrashed falls back to that opaque id before using the id from the request. backport of owncloud#617 Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
Deleteflow previously relied on a couple of awkward patterns to ferry data from the storage driver up to the events interceptor — the deleted file's id was stuffed intoDeleteResponse.Opaque["opaque_id"], and the space owner traveled through a context channel(
ContextSendSpaceOwnerID). Both worked, but they were stringly-typed and easy to lose track of. This PR replaces them with a typed return value.storage.FS.Deletenow returns a*storage.DeleteResultalongside the error. The struct carries the two pieces of information the events interceptor needs:Drivers that have rich data (decomposedfs) populate the result; drivers that don't (s3, eosfs, localfs, ...) return an empty &DeleteResult{} and the conversion layer falls back to req.Ref when building the event. Either way, the published ItemTrashed payload stays
structurally identical to before.
To get the typed result from the driver to the events interceptor without changing the gRPC protobuf, the storageprovider writes it into a DeleteResultSlot registered in the context — a small mutable container the interceptor allocates before the handler runs and reads
back after. Same trick as the existing sendOwnerChan pattern, but typed and one-shot.
A few related cleanups come along for the ride:
extra round-trip on every delete across every backend.
Acceptance criteria
Test plan