taers232c / GAMADV-XTD3

Command line tool to manage Google Workspace
703 stars 87 forks source link

'collect orphans' behaviour is poorly explained and likely undesirable, since multiple parents are no longer allowed #303

Closed Brendaneade closed 1 year ago

Brendaneade commented 1 year ago

Hi Ross

I have just run collect orphans on a few accounts without checking the fine print (recently), to find that it pulls files out of shared folder structures when the user doesn't own the parent. To my intuition these are not orphaned files at all, and shouldn't have been touched.

I guess that this was acceptable behaviour when multiple parents were allowed, since adding them to an 'orphaned files' folder wouldn't remove them from a shared one, but now it does.

The only hint that this may happen is this: useshortcuts false - Add the target user folder as a parent of an orphan; this is the default behavior. This may now fail as the orphan may have parents belonging to other users and files can now have only one parent.

I would suggest that this needs to be changed to only affect true orphans (files with no parent, regardless of ownership), and/or be much better documented.

Thanks

Brendaneade commented 1 year ago

Actually there is more nuance here - they were files that were in a shared structure that the user no longer had access to. To the owner they were orphaned, but to everyone else they were where they belonged.

taers232c commented 1 year ago

I'm available right now if you'd line to Meet/Zoom to discuss.

ross.scroggs @ gmail.com

taers232c commented 1 year ago

I'm in California (PDT) and am available starting at 9:00AM tomorrow; send me a Meet/Zoom invitation and we can discuss.

The API doesn't tell me about parents of files that I own in a folder owned by someone else; it just says that the file has no parents. The user that owns the parent folder would see that the file has parents in its world.

Ross

Ross Scroggs @.***

On Sep 13, 2022, at 4:57 PM, Brendaneade @.***> wrote:

Hi Ross

I have just run collect orphans on a few accounts without checking the fine print (recently), to find that it pulls files out of shared folder structures when the user doesn't own the parent. To my intuition these are not orphaned files at all, and shouldn't have been touched.

I guess that this was acceptable behaviour when multiple parents were allowed, since adding them to an 'orphaned files' folder wouldn't remove them from a shared one, but now it does.

The only hint that this may happen is this: useshortcuts false - Add the target user folder as a parent of an orphan; this is the default behavior. This may now fail as the orphan may have parents belonging to other users and files can now have only one parent.

I would suggest that this needs to be changed to only affect true orphans (files with no parent, regardless of ownership), and/or be much better documented.

Thanks

— Reply to this email directly, view it on GitHub https://github.com/taers232c/GAMADV-XTD3/issues/303, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCTYL4LYBKDWTISPGZFNWTV6EIEZANCNFSM6AAAAAAQL5CDIQ. You are receiving this because you are subscribed to this thread.

Brendaneade commented 1 year ago

Not sure if you saw my email, but I noticed the capability attribute CanAddMyDriveParent which appears to be true only for the true orphans. We could check that before moving, and otherwise just use shortcuts.

That said, I'm happy with the shortcut-only functionality if it's not worth working on this further. It creates an index of them which is all we need.

I'm busy the rest of this week, free next week if you want to discuss.

taers232c commented 1 year ago

Brendan,

I saw your email; it looks like you've got the right idea. Do we switch the default behavior back to "change parent" or "make a shortcut" based on that flag? useshortcuts true will still do all shortcuts.

Ross

On Tue, Oct 11, 2022 at 12:09 PM Brendaneade @.***> wrote:

Not sure if you saw my email, but I noticed the capability attribute CanAddMyDriveParent https://developers.google.com/resources/api-libraries/documentation/drive/v3/csharp/latest/classGoogle_1_1Apis_1_1Drive_1_1v3_1_1Data_1_1File_1_1CapabilitiesData.html#acc2ec863b0f9f036c74b888062bb407f which appears to be true only for the true orphans. We could check that before moving, and otherwise just use shortcuts.

That said, I'm happy with the shortcut-only functionality if it's not worth working on this further. It creates an index of them which is all we need.

I'm busy the rest of this week, free next week if you want to discuss.

— Reply to this email directly, view it on GitHub https://github.com/taers232c/GAMADV-XTD3/issues/303#issuecomment-1275152502, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCTYLZIZSEJ54K4LEMZEADWCW3O3ANCNFSM6AAAAAAQL5CDIQ . You are receiving this because you commented.Message ID: @.***>

-- Ross Scroggs @.***

Brendaneade commented 1 year ago

Yes, I think so.

Cheers