onedrive icon indicating copy to clipboard operation
onedrive copied to clipboard

Feature Request: Support the syncing of individual business shared files

Open justinabrahms opened this issue 3 years ago • 7 comments

Hi. Me from #1294 which got closed (whew! Quick turn around!)

Even if I create a file at ~/.config/onedrive/sync_list with my file name in it, it never gets pulled down.

I've tried this command:

onedrive --synchronize -v --resync 

The file I want is still seemingly excluded:

WARNING: Not syncing this OneDrive Business Shared File: File I Want.xlsx
OneDrive Business Shared File - Shared By:  Person ([email protected])

I want the file. It's not syncing. Even if I specify * as the entry in sync_list.

As best I can tell, it's being excluded in this line of code: https://github.com/abraunegg/onedrive/blob/3ea16b619fed9b9d04c48cc80904f4910b2b4ac9/src/sync.d#L719

This isn't the only file that's being excluded either. There are several.

WARNING: Not syncing this OneDrive Business Shared File: Tomato Press release_101519_cc.docx
OneDrive Business Shared File - Shared By:  Person1 ([email protected])
WARNING: Not syncing this OneDrive Business Shared File: Consolidated KPIs.pptx
OneDrive Business Shared File - Shared By:  Person2 ([email protected])
WARNING: Not syncing this OneDrive Business Shared File: Prework.pptx
OneDrive Business Shared File - Shared By:  Person3 ([email protected])

The only commonality seems to be that they are docs shared with me and they have spaces in the name.

justinabrahms avatar Feb 26 '21 05:02 justinabrahms

@justinabrahms The issue here is that the "Shared Business Folders" feature, is just that - for syncing business shared folders, shared with you - not individual files that have been shared with you.

Now why do you get this:

WARNING: Not syncing this OneDrive Business Shared File: Tomato Press release_101519_cc.docx
OneDrive Business Shared File - Shared By:  Person1 ([email protected])
WARNING: Not syncing this OneDrive Business Shared File: Consolidated KPIs.pptx
OneDrive Business Shared File - Shared By:  Person2 ([email protected])
WARNING: Not syncing this OneDrive Business Shared File: Prework.pptx
OneDrive Business Shared File - Shared By:  Person3 ([email protected])

This is because the 'SharedWithMe' API call returns all items shared. This client, because of the current feature, excludes files because of the way that this feature is implemented. Files were excluded because of pattern matching issues between various elements, and, to keep the feature in part in-sync with Personal Shared Folders.

Is there anyway to have the user share a specific folder with you - and you sync that folder rather than an individual file?

The only real way to support syncing business shared individual files at present would be to re-write the entire feature so that they are correctly supported with pattern matching between file / folder designations. This would also require a complete re-write of how the folders are stored and represented locally. This would also open up a whole host of other questions & issues - if you have a list of files, and someone shares that file with you, with the same name as someone else, what happens - conflict? overwrite? fail? something else?

Additionally, the OneDrive API (and Azure AD) is, at present, broken for when a file or folder is shared with you, from someone external to your organisation. The authentication process becomes null, thus, you cannot access the file or folder - until MS fix the API / Azure AD - that cannot be supported (see: https://github.com/abraunegg/onedrive/issues/966)

abraunegg avatar Feb 26 '21 06:02 abraunegg

Thanks, abraunegg. Your reasoning makes sense. My intent was a "hey, I want this feature please". I still want the feature, even if it's a pain. That said, if you wanna WONTFIX it, that's cool too. Thanks for building the tool. :)

justinabrahms avatar Feb 26 '21 12:02 justinabrahms

So, how to upload to a shared folder (shared with me by some other user)? Is this feature implemented by now?

ukreddy-erwin avatar May 03 '21 08:05 ukreddy-erwin

So, how to upload to a shared folder (shared with me by some other user)? Is this feature implemented by now?

Please either open a new discussion or open a new issue using the support template. In both cases please be very detailed in what you are trying to achieve and what is not working. Screen shots, log files are needed. Responding to this feature request when your question appears to be non-related is not the way to seek support.

abraunegg avatar May 03 '21 08:05 abraunegg

@abraunegg

The only real way to support syncing business shared individual files at present would be to re-write the entire feature so that they are correctly supported with pattern matching between file / folder designations. This would also require a complete re-write of how the folders are stored and represented locally. This would also open up a whole host of other questions & issues - if you have a list of files, and someone shares that file with you, with the same name as someone else, what happens - conflict? overwrite? fail? something else?

Currently it is also possible to face a situation where two shared folders have the same name. For instance, from my list of shared folders:

Shared Folder:   2021
Shared Folder:   2021
Shared Folder:   2022
Shared Folder:   20220302
Shared Folder:   20220428
Shared Folder:   20220509

I've not included yet any duplicated folder in a business_shared_folders file, so I didn't face any conflict yet. Before going ahead, please, what should I expect in that situation? Thanks!

rrodrigueznt avatar Aug 31 '22 07:08 rrodrigueznt

@rrodrigueznt

I've not included yet any duplicated folder in a business_shared_folders file, so I didn't face any conflict yet. Before going ahead, please, what should I expect in that situation? Thanks!

Not the appropriate place to ask this question - as this item is a Feature Request for Shared Files support

abraunegg avatar Aug 31 '22 07:08 abraunegg

@justinabrahms Whilst this response is a long time coming, unfortunately supporting individual shared file syncing is going to be a real problem.

In the development of v2.5.0 - which is an entire re-write .. the online OneDrive provides zero way to add that individual file to your OneDrive 'My Files' how folders can be added:

Shared Files image

Shared Folders image

Essentially the files lack the 'Add shortcut to My files' capability.

As such, when performing a /delta query or a /children query, those shared files are never going to be made available by the new methods that are being used in v2.5.x codebase to handle Shared Folders.

So for the time being, I am going to have to hit pause on looking at this Feature Request as part of v2.5.0 .. sorry

abraunegg avatar Sep 21 '23 07:09 abraunegg

@justinabrahms , @AnthonyAnkrah

Firstly I apologise for this response is a long time in coming - however this Feature Request has now been completed.

Important: Before you do anything else ... please first read the updated documentation for OneDrive Business Shared Items: https://github.com/abraunegg/onedrive/blob/Implement-Feature-Request-1300/docs/business-shared-items.md

The entire feature has been re-written, how it is implemented has been changed - hopefully the documentation is clear enough on how to configure this feature going forward.

If you want to test the PR, please use the instructions below:

git clone https://github.com/abraunegg/onedrive.git
cd onedrive
git fetch origin pull/2646/head:pr2646
git checkout pr2646

All feedback - positive or negative (or something else) is highly appreciated.

To run the PR, you need to run the client from the PR build directory:

./onedrive <any options needed>

To install the PR, you will need to perform sudo make install to install the PR version.

When running the PR, your version should be: v2.5.0-alpha-5 GitHub version: v2.4.25-93-gfde6f86 or greater

abraunegg avatar Mar 07 '24 07:03 abraunegg

@justinabrahms , @AnthonyAnkrah

Additionally, I want to roll this into 'alpha-5' , then create a 'beta' release :) so this is potentially the last major feature change before a v2.5.0 release.

All feedback , good or bad is highly welcome.

abraunegg avatar Mar 07 '24 07:03 abraunegg

Closing this as code has been merged into 'alpha-5' to allow continued work to progress 'alpha-5' to 'beta' status.

abraunegg avatar Mar 08 '24 20:03 abraunegg

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

abraunegg avatar Mar 16 '24 01:03 abraunegg