cloud-storage-rs icon indicating copy to clipboard operation
cloud-storage-rs copied to clipboard

ObjectClient goes into an infinite loop if it gets a permission error while trying to list the contents of a bucket

Open db48x opened this issue 2 years ago • 0 comments

It should not retry in this case, as it is not going to magically start working without changing the permissions.

    let x = client.object().list(&bucket, Default::default()).await?;
    let count = x
        .map_err(|e| dbg!(anyhow!(e).context("getting data from GCS")))
        .map_ok(|l| {
            println!("got ObjectList with {} items", l.items.len());
            l
        }).count().await;

Also, the documentation claims that “This function will repeatedly query Google and merge the responses into one.”, which is untrue. This function instead returns a Stream of Result<ObjectList>s, as shown clearly by the return value. You might want to fix the description while you’re there.

db48x avatar Mar 24 '22 23:03 db48x