Skip to content

Add Revert Node Functionatlity - #409

Merged
kobergj merged 1 commit into
owncloud:mainfrom
kobergj:AddRevertNode
Oct 1, 2025
Merged

kobergj merged 1 commit into
owncloud:mainfrom
kobergj:AddRevertNode

Conversation

@kobergj

@kobergj kobergj commented Oct 1, 2025

Copy link
Copy Markdown
Collaborator

Adds functionality to revert a node to its previous state

@kobergj
kobergj merged commit cb98fe5 into owncloud:main Oct 1, 2025
@kobergj
kobergj deleted the AddRevertNode branch October 1, 2025 13:41
butonic added a commit to opencloud-eu/reva that referenced this pull request Sep 29, 2026
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.RevertToRevision(ctx, versionID) and
  Node.DeleteCurrentVersion(ctx) to both decomposedfs copies.
  RevertToRevision restores the given revision onto the node (blob
  metadata + mtime) under the node's metadata lock, purging the node
  when versionID is empty. DeleteCurrentVersion reverts to the latest
  revision and removes the processing flag, unstalling the node.
- Add a DeleteRevision postprocessing event. A nil timestamp targets the
  node's current version (revert to the pre-upload state); a given
  timestamp deletes exactly that revision - file, metadata sidecars and
  its own blob.
- Wire upload.Cleanup in both copies to derive the versionID from session
  metadata and delegate to Node.RevertToRevision. 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.

Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
butonic added a commit to opencloud-eu/reva that referenced this pull request Sep 29, 2026
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.RevertToRevision(ctx, versionID) and
  Node.DeleteRevision(ctx, versionID) to both decomposedfs copies.
  RevertToRevision restores the given 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 nil timestamp targets the
  node's current revision (revert to the pre-upload state); a given
  timestamp deletes exactly that revision - file, metadata sidecars and
  its own blob.
- Wire upload.Cleanup in both copies to derive the versionID from session
  metadata and delegate to Node.RevertToRevision. 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]>
butonic added a commit to opencloud-eu/reva that referenced this pull request Sep 29, 2026
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.RevertToRevision(ctx, versionID) and
  Node.DeleteRevision(ctx, versionID) to both decomposedfs copies.
  RevertToRevision restores the given 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 nil timestamp targets the
  node's current revision (revert to the pre-upload state); a given
  timestamp deletes exactly that revision - file, metadata sidecars and
  its own blob.
- Wire upload.Cleanup in both copies to derive the versionID from session
  metadata and delegate to Node.RevertToRevision. 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]>
butonic added a commit to opencloud-eu/reva that referenced this pull request Sep 29, 2026
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. 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]>
butonic added a commit to opencloud-eu/reva that referenced this pull request Sep 29, 2026
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]>
butonic added a commit to opencloud-eu/reva that referenced this pull request Sep 29, 2026
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]>
butonic added a commit to opencloud-eu/reva that referenced this pull request Oct 1, 2026
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]>
butonic added a commit to opencloud-eu/reva that referenced this pull request Oct 2, 2026
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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants