Method DeleteVariantsAsync
DeleteVariantsAsync(FileId, params ReadOnlySpan<string>)
Permanently retires the specified variants of a file, preserving any variant the caller did not list that depends on a listed one.
Declaration
ValueTask<IReadOnlyList<string>> DeleteVariantsAsync(FileId fileId, params ReadOnlySpan<string> variantIds)
Parameters
| Type | Name | Description |
|---|---|---|
| FileId | fileId | The ID of the file whose variants are retired. |
| ReadOnlySpan<string> | variantIds | The full set of variant IDs to retire. Duplicates are ignored and ordering is irrelevant. |
Returns
| Type | Description |
|---|---|
| ValueTask<IReadOnlyList<string>> | The normalized IDs of the variants this call retired, in ordinal order, or an empty list if none needed retiring. Listed IDs that were already retired, have been cleaned up or never existed are not included, and neither are unlisted variants that were preserved. |
Remarks
Pass every variant ID to retire. A variant that is not listed but is an alias of a listed variant is preserved with its content: the earliest such variant is promoted to a data file of its own and the others become aliases of it. Retirement is visible to fetches immediately, and whether the content is removed immediately or by a later cleanup pass depends on DeleteMode.
Retirement is not part of a transaction: it commits on its own as it runs, so it cannot be ordered with an application's database commit. An application that records variant IDs in its database must tolerate a recorded variant being gone, for example by regenerating it on demand with GetOrAddVariantAsync(FileId, string, string?, IFileProcessingPipelineSelector, CancellationToken), rather than rely on the retirement and its database update committing together.
The method is idempotent: an empty list, variants that are already retired and variant IDs that never existed are skipped and left out of the returned list.