RFC-7182: file restoration API#7182
Open
NikitaMatskevich wants to merge 2 commits intoapache:mainfrom
Open
Conversation
meteorgan
reviewed
Feb 7, 2026
Comment on lines
+19
to
+34
| if let Some(v) = version { | ||
| // Restore specific version via copy | ||
| if cap.versioning { | ||
| return self.copy_with(&path, &path).source_version(&v).await; | ||
| } | ||
| } else { | ||
| // Restore soft-deleted via undelete | ||
| if cap.undelete { | ||
| return self.undelete(path).await; | ||
| } | ||
|
|
||
| // Fall back to latest version via copy | ||
| if cap.versioning && cap.list_with_versions { | ||
| let version = self.get_latest_version(path).await?; | ||
| return self.copy_with(&path, &path).source_version(&version).await; | ||
| } |
Contributor
There was a problem hiding this comment.
Would it make sense to let backends handle this themselves ?
Author
There was a problem hiding this comment.
It might be possible to abstract this logic and put it at the interface level. Its similar for many backends, that's why I kept it here. Implementing this separately in every backend would be equivalent to have restore == undelete, as one can implement undelete through versioning or soft-delete based on available capabilities.
meteorgan
reviewed
Feb 7, 2026
meteorgan
reviewed
Feb 7, 2026
a6eaaa7 to
6403cc3
Compare
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.
Which issue does this PR close?
Closes ##7178.
Rationale for this change
Explained in the RFC.
What changes are included in this PR?
An RFC doc stating the future feature design choices, to be reviewed and agreed upon.