tidyverse / googledrive

Google Drive R API
https://googledrive.tidyverse.org/
Other
322 stars 47 forks source link

`drive_share` fails unexpectedly when sharing to certain users #452

Open fisher-j opened 5 months ago

fisher-j commented 5 months ago

Function works for most users. Fails unexpectedly with certain users (2 out of 60). The file does end up being shared.

The error:

Caused by error in `map_chr()`:
i In index: 1.
Caused by error:
! Result must be length 1, not 0.

referring to this line: https://github.com/tidyverse/googledrive/blob/ed574d9eb3308619fc3e735251bfd42e6cfdb8e2/R/drive_share.R#L96

Apparently, the result of the previous line (permission_out) does not have the expected content.

I'm passing a 1-row dribble, to which I've added email and message columns. Constructing a reproducible example is difficult, because I'm not sure why these two dribbles are failing. They seem very similar to the rest of the rows, which do work. I could share a dput of the offending rows, but I'd want to be sure this is safe (not sharing sensitive user data).

This is what they look like, superficially

  vendor_name             name                                      id                                drive_resource    email
  <chr>                   <chr>                                     <drv_id>                          <list>            <chr>
1 Fat Cat Bakes           Fat-Cat-Bakes-mar-16-31-2024.pdf          1hLH53FPB8NrRDC99z23UeIXWzANzQcBm <named list [41]> rhiannon.cattaneo@outlook.com
2 Nona's Bulgarian Yogurt Nonas-Bulgarian-Yogurt-mar-16-31-2024.pdf 1RNA2ftfu3BvDSLMmcftISkZgCHlak8Jp <named list [41]> nmineva@yahoo.com
jennybc commented 5 months ago

If you're in a position to install googledrive from source, you could put a breakpoint / browser call at the offending line and take a look at the permission_out object to get more information.