Skip to main content

object_delete_batch

Function object_delete_batch 

Source
pub async fn object_delete_batch(
    profile_id: ProfileId,
    bucket: BucketId,
    keys: Vec<DeleteKey>,
    store: State<'_, ProfileStoreHandle>,
    pool: State<'_, S3ClientPoolHandle>,
    locks: State<'_, LockRegistryHandle>,
    cache: State<'_, CacheHandle>,
    channel: AppHandle,
) -> Result<DeleteReport, AppError>
Expand description

Delete keys from bucket using the S3 batched DeleteObjects API.

  • Groups keys by parent prefix and acquires one lock per unique prefix.
  • Issues the batch delete (chunked at 1 000 keys per AWS limit).
  • Invalidates cache and emits objects:updated once per unique affected prefix (only for prefixes that had at least one successfully deleted key).
  • All locks are released before returning.

Partial per-key failures (AC-4) are returned in DeleteReport.failed. A non-empty failed list is NOT an Err — the caller decides UI handling.