feat(boxstore): add one-time download retention mode
Introduce a `one-time` retention option and persist it on the manifest as `one_time_download`. One-time download boxes bypass retention expiry scheduling, force zip downloads, and reject download attempts until all files are complete to prevent partial retrievals.feat(boxstore): add one-time download retention mode Introduce a `one-time` retention option and persist it on the manifest as `one_time_download`. One-time download boxes bypass retention expiry scheduling, force zip downloads, and reject download attempts until all files are complete to prevent partial retrievals.
This commit is contained in:
@@ -42,3 +42,20 @@ func TestStartRetentionBeginsWhenEveryFileIsTerminal(t *testing.T) {
|
||||
t.Fatalf("expected retention to start from completion time, got %s", manifest.ExpiresAt)
|
||||
}
|
||||
}
|
||||
|
||||
func TestStartRetentionSkipsOneTimeDownload(t *testing.T) {
|
||||
manifest := models.BoxManifest{
|
||||
RetentionSecs: 10,
|
||||
OneTimeDownload: true,
|
||||
Files: []models.BoxFile{
|
||||
{ID: "one", Status: models.FileStatusReady},
|
||||
{ID: "two", Status: models.FileStatusReady},
|
||||
},
|
||||
}
|
||||
|
||||
startRetentionIfTerminalUnlocked(&manifest)
|
||||
|
||||
if !manifest.ExpiresAt.IsZero() {
|
||||
t.Fatalf("expected one-time download box to avoid retention expiry, got %s", manifest.ExpiresAt)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user