-
Notifications
You must be signed in to change notification settings - Fork 710
RFC-7182: file restoration API #7182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
RFC-7182: file restoration API #7182
Conversation
| 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; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to let backends handle this themselves ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
a6eaaa7 to
6403cc3
Compare
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.