Skip to content

Conversation

@NikitaMatskevich
Copy link

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.

@NikitaMatskevich NikitaMatskevich marked this pull request as ready for review February 7, 2026 09:16
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. releases-note/docs The PR modifies docs related content or has a title that begins with "docs" labels Feb 7, 2026
Comment on lines +19 to +50
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;
}
Copy link
Contributor

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 ?

Copy link
Author

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.

@meteorgan meteorgan changed the title docs: add an RFC for file restoration API RFC-7182: file restoration API Feb 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

releases-note/docs The PR modifies docs related content or has a title that begins with "docs" size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants