Skip to content

feat: add delete revision functionality - #821

Merged
butonic merged 2 commits into
mainfrom
port-409
Oct 2, 2026
Merged

butonic merged 2 commits into
mainfrom
port-409

Conversation

@butonic

@butonic butonic commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

opencloud pr with cli command changes will follow

@butonic butonic self-assigned this Sep 24, 2026
@butonic butonic added the Type:Maintenance E.g. technical debt, packaging, etc. label Sep 24, 2026
@github-project-automation github-project-automation Bot moved this to Qualification in OpenCloud Team Board Sep 24, 2026
@butonic butonic moved this from Qualification to In Progress in OpenCloud Team Board Sep 24, 2026
@butonic
butonic marked this pull request as draft September 24, 2026 11:36
@butonic
butonic marked this pull request as ready for review September 24, 2026 11:43
@butonic
butonic marked this pull request as draft September 24, 2026 14:46
@butonic

butonic commented Sep 24, 2026

Copy link
Copy Markdown
Member Author

needs to take #424 into acccount

@butonic
butonic force-pushed the port-409 branch 2 times, most recently from 669fdc3 to 20bd381 Compare September 28, 2026 12:58
@butonic
butonic marked this pull request as ready for review September 28, 2026 15:16
@butonic
butonic requested a review from micbar September 28, 2026 15:17
@butonic
butonic marked this pull request as draft September 28, 2026 16:39
@butonic

butonic commented Sep 28, 2026

Copy link
Copy Markdown
Member Author

I need to revisit this ...

@butonic
butonic force-pushed the port-409 branch 2 times, most recently from 4330983 to 24d9605 Compare September 29, 2026 09:51
@butonic butonic changed the title feat: add revert node functionality feat: add delete revision functionality Sep 29, 2026
@butonic
butonic force-pushed the port-409 branch 7 times, most recently from 2eb06b7 to 50dbc8f Compare October 1, 2026 07:57
2403905 and others added 2 commits October 2, 2026 09:00
Add functionality to revert a node to its previous state and to delete a
specific revision, inspired by owncloud#409 and adapted to the
posix (.oc-nodes) layout of our decomposedfs fork:

- Add Node.RevertUpload(ctx, versionID) and Node.DeleteRevision(ctx,
  versionID) to both decomposedfs copies. RevertUpload reverts the upload
  that created the given revision: it restores the revision onto the node
  (blob metadata + mtime) under the node's metadata lock and removes the
  revision, including its metadata sidecars. DeleteRevision deletes a
  revision and returns its blob id so the caller can delete the blob; an
  empty versionID targets the node's current revision - the latest stored
  revision is restored (or the node purged when there is none) and the
  processing flag is removed, unstalling the node.
- Add a DeleteRevision postprocessing event. A given timestamp deletes
  exactly that revision - file, metadata sidecars and its own blob - which
  can also be used to implement retention rules by emitting the event from
  a cron job or housekeeping service. A nil timestamp targets the node's
  current revision (revert to the pre-upload state) and only applies while
  the node is stuck in processing, so a redelivered event is a no-op
  instead of consuming ever older revisions.
- Wire upload.Cleanup in both copies to derive the versionID from session
  metadata and delegate to Node.RevertUpload. This also fixes the antivirus
  postprocessing delete path on posix, where the glob-based lookup of the
  original port never matched.
- Fix the CS3 DeleteFileVersions paths to delete the revision node's own
  blob and metadata sidecars instead of the live file's blob, by delegating
  to Node.DeleteRevision.
- Consume reverted revisions fully (data file + metadata sidecars) instead
  of leaking them, and stop upload Finalize from recreating a duplicate
  revision when the node already contains the upload's own content (e.g.
  after a newer upload was reverted).

Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type:Maintenance E.g. technical debt, packaging, etc.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants