Bound restore and publication verification downloads
This commit is contained in:
@@ -58,6 +58,15 @@ type RestoreAction struct {
|
||||
VerifiedContent []byte
|
||||
}
|
||||
|
||||
// A committed identity declares its size even when it is zero. Legacy raw
|
||||
// audio listings use zero for a missing size and retain unknown-size handling.
|
||||
func restoreExpectedSize(action RestoreAction) *int64 {
|
||||
if action.Size > 0 || action.SHA256 != "" || action.Generation != "" {
|
||||
return &action.Size
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// RestorePlan is the deterministic output of restore planning.
|
||||
type RestorePlan struct {
|
||||
Actions []RestoreAction
|
||||
@@ -495,7 +504,7 @@ func classifyRestoreAction(
|
||||
if err != nil {
|
||||
return RestoreAction{}, fmt.Errorf("checksum local file: %w", err)
|
||||
}
|
||||
remotePath, err := storage.DownloadObjectToTemp(ctx, store, action.RemoteKey, "narratio-restore-plan-remote-*.tmp")
|
||||
remotePath, err := storage.DownloadObjectToTemp(ctx, store, action.RemoteKey, "narratio-restore-plan-remote-*.tmp", restoreExpectedSize(action))
|
||||
if err != nil {
|
||||
return RestoreAction{}, fmt.Errorf("download remote object: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user