Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Handle moving of Shared Folders for Business Accounts #2824

Open
divico opened this issue Sep 18, 2024 · 10 comments · May be fixed by #3052
Open

Feature Request: Handle moving of Shared Folders for Business Accounts #2824

divico opened this issue Sep 18, 2024 · 10 comments · May be fixed by #3052

Comments

@divico
Copy link

divico commented Sep 18, 2024

Is your feature request related to a problem? Please describe.

It would be helpful to be able to move OneDrive Business Shared Folders to a different location within OneDrive than the default "My Files" location. With a growing number of shared folders, the folder structure in "My Files" can get very messy.

Currently, syncing OneDrive Business Shared Folders works only as long as the folder (i.e. the shortcut) is left in the default location, that is at the root of its own OneDrive folder structure (i.e. "My Files").

Describe the solution you'd like

The optimal solution is to behave like the Windows client. The shared folders (i.e. shortcuts) can be moved to any other location which is then reflected locally.

Describe alternatives you've considered

Not great, but creating local symlinks outside the OneDrive folder pointing to the shared folders in OneDrive would allow you to get some sort of folder structure of the shared folders.

Additional context

Refer to: #2821

@divico divico added the Feature Request Feature Request | Enhancement Request label Sep 18, 2024
@abraunegg abraunegg added this to the v2.5.x milestone Sep 18, 2024
abraunegg added a commit that referenced this issue Dec 26, 2024
* Implement Feature Request #2824 to support the moving of Shared Folder Links to other folders
@abraunegg
Copy link
Owner

abraunegg commented Dec 26, 2024

@divico

Important

Relocatable Shared Folder Links is only a OneDrive Business supported capability. Microsoft does not support this for OneDrive Personal account types.

Please can you test extensively this PR that implements this feature request.

This PR specifically builds on the changes implemented in PR #3051

To test this PR, first install all the require platform dependencies to build the client on your respective platforms. Please read https://github.com/abraunegg/onedrive/blob/master/docs/install.md#building-from-source---high-level-requirements and then follow correctly for your platform.

Once this is done, to clone the PR to resolve your issue, you can use a script like the following:

#!/bin/bash

PR=3052

rm -rf ./onedrive-pr${PR}
git clone https://github.com/abraunegg/onedrive.git onedrive-pr${PR}
cd onedrive-pr${PR}
git fetch origin pull/${PR}/head:pr${PR}
git checkout pr${PR}

# Configure and Build
./configure --enable-debug --enable-notifications; make clean; make;
./onedrive --version

This script will create a local folder called onedrive-pr3052 with the PR version.

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

./onedrive <any other options needed>

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

When running the PR, your version should be: onedrive v2.5.3-31-gdef04a4 or greater.

Please note PR #3051 and PR #3052 have a DB schema change which forces a resync.

PR Evidence

Online Folder Structure

image
image
image

PR Application Output

Reading configuration file: /home/alex/.config/onedrive/config
Configuration file successfully loaded
Using 'user' configuration path for application config and state data: /home/alex/.config/onedrive
D-Bus message bus daemon is available; GUI notifications are now enabled

ERROR: Unable to create /var/log/onedrive
ERROR: Please manually create '/var/log/onedrive' and set appropriate permissions to allow write access for your user to this location.
ERROR: The requested client activity log will instead be located in your users home directory

Using the following path to store the runtime application log: /home/alex
Deleting the saved application sync status ...
Using IPv4 and IPv6 (if configured) for all network operations
Attempting to contact Microsoft OneDrive Login Service
Successfully reached Microsoft OneDrive Login Service
Checking Application Version ...
Attempting to initialise the OneDrive API ...
Configuring Global Azure AD Endpoints
The OneDrive API was initialised successfully
Opening the item database ...
Application Version:  onedrive v2.5.3-31-gdef04a4
Account Type:         business
Default Drive ID:     b!bO8V7s9SSk6r7mWHpIjURotN33W1W2tEv3OXV_oFIdQimEdOHR-1So7CqeT1MfHA
Default Root ID:      01WIXGO5V6Y2GOVW7725BZO354PWSELRRZ
Remaining Free Space: 1022.62 GB (1098031941419 bytes)
Sync Engine Initialised with new Onedrive API instance
All application operations will be performed in the configured local 'sync_dir' directory: /home/alex/OneDrive
Fetching /delta response from the OneDrive API for Drive ID: b!bO8V7s9SSk6r7mWHpIjURotN33W1W2tEv3OXV_oFIdQimEdOHR-1So7CqeT1MfHA
Processing API Response Bundle: 1 - Quantity of 'changes|items' in this bundle to process: 11
Finished processing /delta JSON response from the OneDrive API
Processing 10 applicable JSON items received from Microsoft OneDrive
Processing OneDrive JSON item batch [1/1] to ensure consistent local state
Creating local directory: ./L18N
Creating local directory: ./L18N/α
Creating local directory: ./L18N/เอกสาร
Creating local directory: ./L18N/Bücher
Creating local directory: ./bad_url_decode
Creating local directory: ./test_folder_in_3040

WARNING: The OneDrive Shared Folder link target 'test_folder_in_3040' cannot be found online using the provided online data.
WARNING: This is potentially a broken online OneDrive Shared Folder link or you no longer have access to it. Please correct this error online.

Creating local directory: ./moved shared folder link
Creating local directory: ./moved shared folder link/Sub Folder 2
WARNING: OneDrive quota information is being restricted. Please fix by speaking to your OneDrive / Office 365 Administrator.
Creating local directory: ./Documents - Issue_3020
Number of items to download from Microsoft OneDrive: 1
Downloading file: bad_url_decode/BTINserye%20Anti-Terror%20Law%20sa%20Wikang%20Filipino%20-%2.mp4 ... done
Syncing this OneDrive Business Shared Folder: test_folder_in_3040

WARNING: The OneDrive Shared Folder link target 'test_folder_in_3040' cannot be found online using the provided online data.
WARNING: This is potentially a broken online OneDrive Shared Folder link or you no longer have access to it. Please correct this error online.

No changes or items that can be applied were discovered while processing the data received from Microsoft OneDrive
Syncing this OneDrive Business Shared Folder: moved shared folder link/Sub Folder 2
Generating a /delta response from the OneDrive API from this Item ID: 01TZRSBFDUQZAUOGZ7BJGZ24DDTBCLCGWI
Adding OneDrive folder details for processing
Adding 2 OneDrive items for processing from the OneDrive Shared Folder
Adding 1 OneDrive items for processing from online_folder_in_sub_folder2
Finished processing self generated /delta JSON response from the OneDrive API
Processing 4 applicable JSON items received from Microsoft OneDrive
Processing OneDrive JSON item batch [1/1] to ensure consistent local state
Creating local directory: ./moved shared folder link/Sub Folder 2/online_folder_in_sub_folder2
Number of items to download from Microsoft OneDrive: 2
Downloading file: moved shared folder link/Sub Folder 2/shared_folder_new_file.txt ... done
Downloading file: moved shared folder link/Sub Folder 2/online_folder_in_sub_folder2/55_44_33_.trc ... done
Syncing this OneDrive Business Shared Folder: Documents - Issue_3020
Generating a /delta response from the OneDrive API from this Item ID: 01D3ZRYZV6Y2GOVW7725BZO354PWSELRRZ
Adding OneDrive folder details for processing
Adding 5 OneDrive items for processing from the OneDrive Shared Folder
Adding 1 OneDrive items for processing from file_over_4Mb_3020
Adding 1 OneDrive items for processing from file_under_4Mb_3020
Adding 1 OneDrive items for processing from newfolder
Adding 1 OneDrive items for processing from non_enrichment_over_4mb_3020
Adding 1 OneDrive items for processing from non_enrichment_under_4Mb_3020
Finished processing self generated /delta JSON response from the OneDrive API
Processing 10 applicable JSON items received from Microsoft OneDrive
Processing OneDrive JSON item batch [1/1] to ensure consistent local state
Creating local directory: ./Documents - Issue_3020/file_over_4Mb_3020
Creating local directory: ./Documents - Issue_3020/file_under_4Mb_3020
Creating local directory: ./Documents - Issue_3020/newfolder
Creating local directory: ./Documents - Issue_3020/non_enrichment_over_4mb_3020
Creating local directory: ./Documents - Issue_3020/non_enrichment_under_4Mb_3020
Number of items to download from Microsoft OneDrive: 5
Downloading file: Documents - Issue_3020/file_under_4Mb_3020/file_under_4mb.docx ... done
Downloading file: Documents - Issue_3020/newfolder/newfile.txt ... done
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 0%   |  ETA    --:--:--
Downloading file: Documents - Issue_3020/non_enrichment_under_4Mb_3020/file1.data ... done
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 5%   |  ETA    00:00:00
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 10%  |  ETA    00:00:00
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 15%  |  ETA    00:00:00
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 0%   |  ETA    --:--:--
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 20%  |  ETA    00:00:00
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 25%  |  ETA    00:00:00
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 30%  |  ETA    00:00:00
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 35%  |  ETA    00:00:00
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 40%  |  ETA    00:00:00
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 45%  |  ETA    00:00:00
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 50%  |  ETA    00:00:00
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 55%  |  ETA    00:00:00
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 60%  |  ETA    00:00:01
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 65%  |  ETA    00:00:01
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 70%  |  ETA    00:00:01
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 75%  |  ETA    00:00:01
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 80%  |  ETA    00:00:01
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 85%  |  ETA    00:00:01
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 90%  |  ETA    00:00:01
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 95%  |  ETA    00:00:01
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 100% | DONE in 00:00:01
Downloading file: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... done
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 10%  |  ETA    00:00:19
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 15%  |  ETA    00:00:09
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 20%  |  ETA    00:00:06
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 25%  |  ETA    00:00:04
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 30%  |  ETA    00:00:03
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 35%  |  ETA    00:00:03
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 40%  |  ETA    00:00:02
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 45%  |  ETA    00:00:02
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 50%  |  ETA    00:00:02
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 55%  |  ETA    00:00:02
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 60%  |  ETA    00:00:02
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 65%  |  ETA    00:00:02
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 70%  |  ETA    00:00:02
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 75%  |  ETA    00:00:01
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 80%  |  ETA    00:00:01
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 85%  |  ETA    00:00:01
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 90%  |  ETA    00:00:01
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 95%  |  ETA    00:00:01
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 100% | DONE in 00:00:02
Downloading file: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... done
Performing a database consistency and integrity check on locally stored data
Processing DB entries for this Drive ID: b!DyXUf1m74EGNtZZj9Hzw3R_ccjiJb9xCvp-4dE_DvZIXUod3Az9ISaTJ7HbNvyDC
Processing: Documents - Issue_3020
The directory has not changed
Processing: Documents - Issue_3020/file_over_4Mb_3020
The directory has not changed
Processing: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx
The file has not changed
Processing: Documents - Issue_3020/file_under_4Mb_3020
The directory has not changed
Processing: Documents - Issue_3020/file_under_4Mb_3020/file_under_4mb.docx
The file has not changed
Processing: Documents - Issue_3020/newfolder
The directory has not changed
Processing: Documents - Issue_3020/newfolder/newfile.txt
The file has not changed
Processing: Documents - Issue_3020/non_enrichment_over_4mb_3020
The directory has not changed
Processing: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data
The file has not changed
Processing: Documents - Issue_3020/non_enrichment_under_4Mb_3020
The directory has not changed
Processing: Documents - Issue_3020/non_enrichment_under_4Mb_3020/file1.data
The file has not changed
Processing DB entries for this Drive ID: b!bO8V7s9SSk6r7mWHpIjURotN33W1W2tEv3OXV_oFIdQimEdOHR-1So7CqeT1MfHA
Processing: ~/OneDrive
The directory has not changed
Processing: L18N
The directory has not changed
Processing: L18N/α
The directory has not changed
Processing: L18N/เอกสาร
The directory has not changed
Processing: L18N/Bücher
The directory has not changed
Processing: bad_url_decode
The directory has not changed
Processing: bad_url_decode/BTINserye%20Anti-Terror%20Law%20sa%20Wikang%20Filipino%20-%2.mp4
The file has not changed
Processing: moved shared folder link
The directory has not changed
Processing DB entries for this Drive ID: b!fZgJhK-pU0eTQpylvmoYCkE4YgH_KRNDlxjRx9OWNqmV9Q_E_uWdRJKIB5L_ruPN
WARNING: OneDrive quota information is being restricted. Please fix by speaking to your OneDrive / Office 365 Administrator.
Processing: moved shared folder link/Sub Folder 2
The directory has not changed
Processing: moved shared folder link/Sub Folder 2
The directory has not changed
Processing: moved shared folder link/Sub Folder 2/online_folder_in_sub_folder2
The directory has not changed
Processing: moved shared folder link/Sub Folder 2/online_folder_in_sub_folder2/55_44_33_.trc
The file has not changed
Processing: moved shared folder link/Sub Folder 2/shared_folder_new_file.txt
The file has not changed
Scanning the local file system '~/OneDrive' for new data to upload
Performing a last examination of the most recent online data within Microsoft OneDrive to complete the reconciliation process
Fetching /delta response from the OneDrive API for Drive ID: b!bO8V7s9SSk6r7mWHpIjURotN33W1W2tEv3OXV_oFIdQimEdOHR-1So7CqeT1MfHA
Processing API Response Bundle: 1 - Quantity of 'changes|items' in this bundle to process: 0
Finished processing /delta JSON response from the OneDrive API
No changes or items that can be applied were discovered while processing the data received from Microsoft OneDrive
Syncing this OneDrive Business Shared Folder: test_folder_in_3040

WARNING: The OneDrive Shared Folder link target 'test_folder_in_3040' cannot be found online using the provided online data.
WARNING: This is potentially a broken online OneDrive Shared Folder link or you no longer have access to it. Please correct this error online.

No changes or items that can be applied were discovered while processing the data received from Microsoft OneDrive
Syncing this OneDrive Business Shared Folder: moved shared folder link/Sub Folder 2
Generating a /delta response from the OneDrive API from this Item ID: 01TZRSBFDUQZAUOGZ7BJGZ24DDTBCLCGWI
Adding OneDrive folder details for processing
Adding 2 OneDrive items for processing from the OneDrive Shared Folder
Adding 1 OneDrive items for processing from online_folder_in_sub_folder2
Finished processing self generated /delta JSON response from the OneDrive API
Processing 4 applicable JSON items received from Microsoft OneDrive
Processing OneDrive JSON item batch [1/1] to ensure consistent local state
Syncing this OneDrive Business Shared Folder: Documents - Issue_3020
Generating a /delta response from the OneDrive API from this Item ID: 01D3ZRYZV6Y2GOVW7725BZO354PWSELRRZ
Adding OneDrive folder details for processing
Adding 5 OneDrive items for processing from the OneDrive Shared Folder
Adding 1 OneDrive items for processing from file_over_4Mb_3020
Adding 1 OneDrive items for processing from file_under_4Mb_3020
Adding 1 OneDrive items for processing from newfolder
Adding 1 OneDrive items for processing from non_enrichment_over_4mb_3020
Adding 1 OneDrive items for processing from non_enrichment_under_4Mb_3020
Finished processing self generated /delta JSON response from the OneDrive API
Processing 10 applicable JSON items received from Microsoft OneDrive
Processing OneDrive JSON item batch [1/1] to ensure consistent local state

Sync with Microsoft OneDrive is complete
Attempting to perform a database vacuum to optimise database
Database vacuum is complete

Local Directory Structure

.
├── bad_url_decode
│   └── BTINserye%20Anti-Terror%20Law%20sa%20Wikang%20Filipino%20-%2.mp4
├── Documents - Issue_3020
│   ├── file_over_4Mb_3020
│   │   └── file_over_4mb.docx
│   ├── file_under_4Mb_3020
│   │   └── file_under_4mb.docx
│   ├── newfolder
│   │   └── newfile.txt
│   ├── non_enrichment_over_4mb_3020
│   │   └── file1.data
│   └── non_enrichment_under_4Mb_3020
│       └── file1.data
├── L18N
│   ├── Bücher
│   ├── α
│   └── เอกสาร
├── moved shared folder link
│   └── Sub Folder 2
│       ├── online_folder_in_sub_folder2
│       │   └── 55_44_33_.trc
│       └── shared_folder_new_file.txt
└── test_folder_in_3040

16 directories, 8 files

@divico
Copy link
Author

divico commented Dec 28, 2024

@abraunegg cool thank you very much for working on my feature request. I could compile the PR on my machine. I will make tests using version onedrive v2.5.3-31-gdef04a4. Can I come back to you by Jan 12 or is it too late?

@abraunegg
Copy link
Owner

abraunegg commented Dec 28, 2024

@divico
Please can you test extensivly so this can be included in v2.5.4 at some point in January.

@abraunegg abraunegg changed the title Feature Request: Handle moving of Shared Folders Feature Request: Handle moving of Shared Folders for Business Accounts Dec 28, 2024
@divico
Copy link
Author

divico commented Jan 7, 2025

@abraunegg I did run first basic tests and it looks fine so far. I'm planing to do more thorough testing in the coming days with multiple shared folders that are moved around and nested. I'll come back to you soon

@abraunegg
Copy link
Owner

abraunegg commented Jan 7, 2025

@divico
Many thanks for your feedback.

This PR is also integrated in #3049 - can you change to test PR #3051 which includes a bugfix for SharePoint Libraries when you add the Document Root.

Any assistance you can provide is greatly appreciated.

@divico
Copy link
Author

divico commented Jan 9, 2025

I tested PR3051 using multiple shared folders and it seems that they are not all correctly handled. Let me know if I can further assist.

Testing done on version

./onedrive --version
onedrive v2.5.3-43-gcbd9127

OneDrive folder structure

git

local folder structure

Running ./onedrive --sync --resync yields

├── Applications
├── Document.docx
├── Folder1
│   ├── Folder21
│   │   ├── Folder3
│   │   └── Shared_folder_1
│   ├── Folder22
│   └── Shared_folder_2
│       └── TestDoc2.docx
├── Microsoft Teams Data
│   └── Wiki
└── Shared_folder_1
    └── TestDoc1.docx

where it can be seen that the location of Shared_folder_1 does not reflect the folder structure on OneDrive

Log output

./onedrive --sync --resync
Reading configuration file: ~/.config/onedrive/config
Configuration file successfully loaded
D-Bus message bus daemon is available; GUI notifications are now enabled

The usage of --resync will delete your local 'onedrive' client state, thus no record of your current 'sync status' will exist.
This has the potential to overwrite local versions of files with perhaps older versions of documents downloaded from OneDrive, resulting in local data loss.
If in doubt, backup your local data before using --resync

Are you sure you wish to proceed with --resync? [Y/N] Y

Deleting the saved application sync status ...
Forcing client to use IPv4 connections only
Attempting to contact Microsoft OneDrive Login Service
Successfully reached Microsoft OneDrive Login Service
Configuring Global Azure AD Endpoints
Fetching items from the OneDrive API for Drive ID: b!IIVaWUPXHUKB_4_bR71QFi6Y-w_tfL5GmlRrNTN9GtBL4C10TKeRTbI74lTfA-Xw .. 
Processing 10 applicable JSON items received from Microsoft OneDrive . 
Number of items to download from Microsoft OneDrive: 1
Downloading file: ./Document.docx ... done
Syncing this OneDrive Business Shared Folder: Folder1/Folder21/Shared_folder_1
Generating a /delta response from the OneDrive API from this Drive ID: b!DYPCSDIDh0ynVuHfilYrW6ZmgimMctBMhb10CmpoQLNRBk0YFeyWRZ9juMzbP3tL and Item ID: 01PZD27NTZZ4H5Q4USXFDICNCASF45ZHOE . 
Finished processing self generated /delta JSON response from the OneDrive API
Processing 2 applicable JSON items received from Microsoft OneDrive ..WARNING: OneDrive API inconsistency - this file does not have any hash: Shared_folder_1/TestDoc1.docx
 
Number of items to download from Microsoft OneDrive: 1
ERROR: File download hash mismatch. Increase logging verbosity to determine why.
INFO: Potentially add --disable-download-validation to work around this issue but downloaded data integrity cannot be guaranteed.
Removing local file Shared_folder_1/TestDoc1.docx due to failed integrity checks
Downloading file: Shared_folder_1/TestDoc1.docx ... failed!
Syncing this OneDrive Business Shared Folder: Folder1/Shared_folder_2
Generating a /delta response from the OneDrive API from this Drive ID: b!DYPCSDIDh0ynVuHfilYrW6ZmgimMctBMhb10CmpoQLNRBk0YFeyWRZ9juMzbP3tL and Item ID: 01PZD27NTZBKAGGPCTA5D2TYOOL6BDAPQN . 
Finished processing self generated /delta JSON response from the OneDrive API
Processing 2 applicable JSON items received from Microsoft OneDrive .WARNING: OneDrive API inconsistency - this file does not have any hash: Folder1/Shared_folder_2/TestDoc2.docx
 
Number of items to download from Microsoft OneDrive: 1
ERROR: File download hash mismatch. Increase logging verbosity to determine why.
INFO: Potentially add --disable-download-validation to work around this issue but downloaded data integrity cannot be guaranteed.
Removing local file Folder1/Shared_folder_2/TestDoc2.docx due to failed integrity checks
Downloading file: Folder1/Shared_folder_2/TestDoc2.docx ... failed!
Performing a database consistency and integrity check on locally stored data .. 
Scanning the local file system '~/OneDrive' for new data to upload . 
Performing a last examination of the most recent online data within Microsoft OneDrive to complete the reconciliation process
Fetching items from the OneDrive API for Drive ID: b!IIVaWUPXHUKB_4_bR71QFi6Y-w_tfL5GmlRrNTN9GtBL4C10TKeRTbI74lTfA-Xw . 
No changes or items that can be applied were discovered while processing the data received from Microsoft OneDrive
Syncing this OneDrive Business Shared Folder: Folder1/Folder21/Shared_folder_1
Generating a /delta response from the OneDrive API from this Drive ID: b!DYPCSDIDh0ynVuHfilYrW6ZmgimMctBMhb10CmpoQLNRBk0YFeyWRZ9juMzbP3tL and Item ID: 01PZD27NTZZ4H5Q4USXFDICNCASF45ZHOE . 
Finished processing self generated /delta JSON response from the OneDrive API
Processing 2 applicable JSON items received from Microsoft OneDrive . 
Number of items to download from Microsoft OneDrive: 1
Downloading file: Shared_folder_1/TestDoc1.docx ... done
Syncing this OneDrive Business Shared Folder: Folder1/Shared_folder_2
Generating a /delta response from the OneDrive API from this Drive ID: b!DYPCSDIDh0ynVuHfilYrW6ZmgimMctBMhb10CmpoQLNRBk0YFeyWRZ9juMzbP3tL and Item ID: 01PZD27NTZBKAGGPCTA5D2TYOOL6BDAPQN . 
Finished processing self generated /delta JSON response from the OneDrive API
Processing 2 applicable JSON items received from Microsoft OneDrive .. 
Number of items to download from Microsoft OneDrive: 1
Downloading file: Folder1/Shared_folder_2/TestDoc2.docx ... done

Sync with Microsoft OneDrive is complete
Attempting to perform a database vacuum to optimise database
Database vacuum is complete



@divico
Copy link
Author

divico commented Jan 9, 2025

Another thing to think about:
Moving the shared folder on the local file system and then running --sync will silently (in case one is not reading the verbose log output) delete the shared folder on OneDrive, create a regular folder on OneDrive at the new location and copy all files into that new folder. This could be misleading as the user may think they are still working on shared files which is not the case anymore.
If it is technically too difficult to implement two-way moving of shared folders, I would suggest not letting the user move shared folders from local to OneDrive and throw an error message instead

@abraunegg
Copy link
Owner

@divico
Thanks for testing the other PR.

Please can you revert to teating just the original PR #3052

Next week I will look at merging the base (3051), then come back to any issues you have identified with 3052.

@abraunegg
Copy link
Owner

@divico

I cannot reproduce your latest issue using PR #3052 mirroring (as much as possible) your shared folder structure:

onedrive v2.5.3-34-g0a23738

Online State

image
image
image
image
image
image

Log Output

Reading configuration file: /home/alex/.config/onedrive/config
Configuration file successfully loaded
Using 'user' configuration path for application config and state data: /home/alex/.config/onedrive
D-Bus message bus daemon is available; GUI notifications are now enabled

ERROR: Unable to create /var/log/onedrive
ERROR: Please manually create '/var/log/onedrive' and set appropriate permissions to allow write access for your user to this location.
ERROR: The requested client activity log will instead be located in your users home directory

Using the following path to store the runtime application log: /home/alex
Deleting the saved application sync status ...
Using IPv4 and IPv6 (if configured) for all network operations
Attempting to contact Microsoft OneDrive Login Service
Successfully reached Microsoft OneDrive Login Service
Checking Application Version ...
Attempting to initialise the OneDrive API ...
Configuring Global Azure AD Endpoints
The OneDrive API was initialised successfully
Opening the item database ...
Application Version:  onedrive v2.5.3-34-g0a23738
Account Type:         business
Default Drive ID:     b!bO8V7s9SSk6r7mWHpIjURotN33W1W2tEv3OXV_oFIdQimEdOHR-1So7CqeT1MfHA
Default Root ID:      01WIXGO5V6Y2GOVW7725BZO354PWSELRRZ
Remaining Free Space: 1022.62 GB (1098026693350 bytes)
Sync Engine Initialised with new Onedrive API instance
All application operations will be performed in the configured local 'sync_dir' directory: /home/alex/OneDrive
Fetching /delta response from the OneDrive API for Drive ID: b!bO8V7s9SSk6r7mWHpIjURotN33W1W2tEv3OXV_oFIdQimEdOHR-1So7CqeT1MfHA
Processing API Response Bundle: 1 - Quantity of 'changes|items' in this bundle to process: 26
Skipping path - The Microsoft OneNote Notebook File '/Notebooks/asdfasdfasdf/Untitled Section.one' is not supported by this client
Skipping path - The Microsoft OneNote Notebook File '/Notebooks/asdfasdfasdf/Open Notebook.onetoc2' is not supported by this client
Skipping path - The Microsoft OneNote Notebook File '/Notebooks/asdfasdfasdf/sdfgsd43.one' is not supported by this client
Finished processing /delta JSON response from the OneDrive API
Processing 22 applicable JSON items received from Microsoft OneDrive
Processing OneDrive JSON item batch [1/1] to ensure consistent local state
Creating local directory: ./L18N
Creating local directory: ./L18N/α
Creating local directory: ./L18N/เอกสาร
Creating local directory: ./L18N/Bücher
Creating local directory: ./bad_url_decode
Creating local directory: ./test_folder_in_3040

WARNING: The OneDrive Shared Folder link target 'test_folder_in_3040' cannot be found online using the provided online data.
WARNING: This is potentially a broken online OneDrive Shared Folder link or you no longer have access to it. Please correct this error online.

Creating local directory: ./moved shared folder link
Creating local directory: ./moved shared folder link/Sub Folder 2
WARNING: OneDrive quota information is being restricted. Please fix by speaking to your OneDrive / Office 365 Administrator.
Creating local directory: ./Documents - Issue_3020
Creating local directory: ./3A
Creating local directory: ./Notebooks
Creating local directory: ./Notebooks/asdfasdfasdf
Creating local directory: ./Issue 3057
Creating local directory: ./Folder1
Creating local directory: ./Folder1/Folder21
Creating local directory: ./Folder1/Folder21/Folder3
Creating local directory: ./Folder1/Folder21/Jenkins
WARNING: OneDrive quota information is being restricted. Please fix by speaking to your OneDrive / Office 365 Administrator.
Creating local directory: ./Folder1/Folder22
Creating local directory: ./Folder1/Sub Folder 3
Number of items to download from Microsoft OneDrive: 3
Downloading file: bad_url_decode/BTINserye%20Anti-Terror%20Law%20sa%20Wikang%20Filipino%20-%2.mp4 ... done
Downloading file: Issue 3057/Presentation.pptx ... done
Downloading file: Issue 3057/Presentation1.pptx ... done
Syncing this OneDrive Business Shared Folder: test_folder_in_3040

WARNING: The OneDrive Shared Folder link target 'test_folder_in_3040' cannot be found online using the provided online data.
WARNING: This is potentially a broken online OneDrive Shared Folder link or you no longer have access to it. Please correct this error online.

No changes or items that can be applied were discovered while processing the data received from Microsoft OneDrive
Syncing this OneDrive Business Shared Folder: moved shared folder link/Sub Folder 2
Generating a /delta response from the OneDrive API from this Drive ID: b!fZgJhK-pU0eTQpylvmoYCkE4YgH_KRNDlxjRx9OWNqmV9Q_E_uWdRJKIB5L_ruPN and Item ID: 01TZRSBFDUQZAUOGZ7BJGZ24DDTBCLCGWI
Adding OneDrive folder details for processing
Adding 2 OneDrive items for processing from the OneDrive Shared Folder
Adding 1 OneDrive items for processing from online_folder_in_sub_folder2
Finished processing self generated /delta JSON response from the OneDrive API
Processing 4 applicable JSON items received from Microsoft OneDrive
Processing OneDrive JSON item batch [1/1] to ensure consistent local state
Creating local directory: ./moved shared folder link/Sub Folder 2/online_folder_in_sub_folder2
Number of items to download from Microsoft OneDrive: 2
Downloading file: moved shared folder link/Sub Folder 2/shared_folder_new_file.txt ... done
Downloading file: moved shared folder link/Sub Folder 2/online_folder_in_sub_folder2/55_44_33_.trc ... done
Syncing this OneDrive Business Shared Folder: Documents - Issue_3020
Generating a /delta response from the OneDrive API from this Drive ID: b!DyXUf1m74EGNtZZj9Hzw3R_ccjiJb9xCvp-4dE_DvZIXUod3Az9ISaTJ7HbNvyDC and Item ID: 01D3ZRYZV6Y2GOVW7725BZO354PWSELRRZ
Adding OneDrive folder details for processing
Adding 5 OneDrive items for processing from the OneDrive Shared Folder
Adding 1 OneDrive items for processing from file_over_4Mb_3020
Adding 1 OneDrive items for processing from file_under_4Mb_3020
Adding 1 OneDrive items for processing from newfolder
Adding 1 OneDrive items for processing from non_enrichment_over_4mb_3020
Adding 1 OneDrive items for processing from non_enrichment_under_4Mb_3020
Finished processing self generated /delta JSON response from the OneDrive API
Processing 10 applicable JSON items received from Microsoft OneDrive
Processing OneDrive JSON item batch [1/1] to ensure consistent local state
Creating local directory: ./Documents - Issue_3020/file_over_4Mb_3020
Creating local directory: ./Documents - Issue_3020/file_under_4Mb_3020
Creating local directory: ./Documents - Issue_3020/newfolder
Creating local directory: ./Documents - Issue_3020/non_enrichment_over_4mb_3020
Creating local directory: ./Documents - Issue_3020/non_enrichment_under_4Mb_3020
Number of items to download from Microsoft OneDrive: 5
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 0%   |  ETA    --:--:--
Downloading file: Documents - Issue_3020/newfolder/newfile.txt ... done
Downloading file: Documents - Issue_3020/file_under_4Mb_3020/file_under_4mb.docx ... done
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 0%   |  ETA    --:--:--
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 5%   |  ETA    00:00:19
Downloading file: Documents - Issue_3020/non_enrichment_under_4Mb_3020/file1.data ... done
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 10%  |  ETA    00:00:09
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 5%   |  ETA    00:00:19
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 15%  |  ETA    00:00:06
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 20%  |  ETA    00:00:04
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 10%  |  ETA    00:00:09
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 15%  |  ETA    00:00:06
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 20%  |  ETA    00:00:04
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 25%  |  ETA    00:00:03
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 25%  |  ETA    00:00:03
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 30%  |  ETA    00:00:03
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 30%  |  ETA    00:00:03
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 35%  |  ETA    00:00:02
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 35%  |  ETA    00:00:02
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 40%  |  ETA    00:00:02
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 40%  |  ETA    00:00:02
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 45%  |  ETA    00:00:02
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 45%  |  ETA    00:00:02
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 50%  |  ETA    00:00:01
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 55%  |  ETA    00:00:01
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 50%  |  ETA    00:00:01
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 60%  |  ETA    00:00:01
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 55%  |  ETA    00:00:01
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 70%  |  ETA    00:00:02
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 60%  |  ETA    00:00:02
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 75%  |  ETA    00:00:01
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 65%  |  ETA    00:00:02
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 80%  |  ETA    00:00:01
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 85%  |  ETA    00:00:01
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 70%  |  ETA    00:00:01
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 75%  |  ETA    00:00:01
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 90%  |  ETA    00:00:01
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 80%  |  ETA    00:00:01
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 95%  |  ETA    00:00:01
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 85%  |  ETA    00:00:01
Downloading: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... 100% | DONE in 00:00:02
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 90%  |  ETA    00:00:01
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 95%  |  ETA    00:00:01
Downloading file: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data ... done
Downloading: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... 100% | DONE in 00:00:02
Downloading file: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx ... done
Syncing this OneDrive Business Shared Folder: 3A
Generating a /delta response from the OneDrive API from this Drive ID: b!3Uyf_G4r-UKmoULFvShByvgolNg2SJRIhG4F_V15hB2En6zphwcvTJhA3eBRuImN and Item ID: 01Q5HFMF5FR4UZ3S52WBBY2FODXG7JRIVB
Adding OneDrive folder details for processing
Adding 17 OneDrive items for processing from the OneDrive Shared Folder
Adding 1 OneDrive items for processing from 1
Adding 1 OneDrive items for processing from new_folder_1761
Adding 1 OneDrive items for processing from new_folder_1761_folder2
Finished processing self generated /delta JSON response from the OneDrive API
Processing 21 applicable JSON items received from Microsoft OneDrive
Processing OneDrive JSON item batch [1/1] to ensure consistent local state
Creating local directory: ./3A/1
Creating local directory: ./3A/new_folder_1761
Creating local directory: ./3A/new_folder_1761_folder2
Number of items to download from Microsoft OneDrive: 17
Downloading file: 3A/1/Document2.docx ... done
Downloading file: 3A/another_new_file.txt ... done
Downloading file: 3A/Presentation2.pptx ... done
Downloading file: 3A/new_file_shared_folder.txt ... done
Downloading file: 3A/new_folder_1761_folder2/new_file_1761_2.txt ... done
Downloading file: 3A/debug_output.log ... done
Downloading file: 3A/Presentation.pptx ... done
Downloading file: 3A/new_folder_1761/new_file_1761.txt ... done
Downloading file: 3A/Presentation5.pptx ... done
Downloading file: 3A/Presentation8.pptx ... done
Downloading file: 3A/Presentation3.pptx ... done
Downloading: 3A/Remove Ubuntu Package.docx ... 0%   |  ETA    --:--:--
Downloading file: 3A/Presentation6.pptx ... done
Downloading file: 3A/Presentation9.pptx ... done
Downloading file: 3A/Presentation7.pptx ... done
Downloading file: 3A/Presentation4.pptx ... done
Downloading: 3A/Remove Ubuntu Package.docx ... 15%  |  ETA    00:00:19
Downloading: 3A/Remove Ubuntu Package.docx ... 20%  |  ETA    00:00:09
Downloading: 3A/Remove Ubuntu Package.docx ... 25%  |  ETA    00:00:06
Downloading: 3A/Remove Ubuntu Package.docx ... 30%  |  ETA    00:00:04
Downloading: 3A/Remove Ubuntu Package.docx ... 35%  |  ETA    00:00:03
Downloading: 3A/Remove Ubuntu Package.docx ... 40%  |  ETA    00:00:03
Downloading: 3A/Remove Ubuntu Package.docx ... 45%  |  ETA    00:00:02
Downloading: 3A/Remove Ubuntu Package.docx ... 50%  |  ETA    00:00:02
Downloading: 3A/Remove Ubuntu Package.docx ... 55%  |  ETA    00:00:02
Downloading: 3A/Remove Ubuntu Package.docx ... 60%  |  ETA    00:00:01
Downloading: 3A/Remove Ubuntu Package.docx ... 65%  |  ETA    00:00:01
Downloading: 3A/Remove Ubuntu Package.docx ... 70%  |  ETA    00:00:01
Downloading: 3A/Remove Ubuntu Package.docx ... 75%  |  ETA    00:00:01
Downloading: 3A/Remove Ubuntu Package.docx ... 80%  |  ETA    00:00:01
Downloading: 3A/Remove Ubuntu Package.docx ... 85%  |  ETA    00:00:01
Downloading: 3A/Remove Ubuntu Package.docx ... 90%  |  ETA    00:00:01
Downloading: 3A/Remove Ubuntu Package.docx ... 95%  |  ETA    00:00:01
Downloading: 3A/Remove Ubuntu Package.docx ... 100% | DONE in 00:00:01
Downloading file: 3A/Remove Ubuntu Package.docx ... done
Downloading file: 3A/single-dir-new-file.txt ... done
Syncing this OneDrive Business Shared Folder: Folder1/Folder21/Jenkins
Generating a /delta response from the OneDrive API from this Drive ID: b!BhWyqa7K_kqXqHtSIlsqjR5iJogxpWxDradnpVGTU2VxBOJh82Y6S4he4rdnGPBT and Item ID: 01FBLR4V3MQE5SZJQROFGZXLDYVJ5LY7NM
Adding OneDrive folder details for processing
Adding 5 OneDrive items for processing from the OneDrive Shared Folder
Adding 1 OneDrive items for processing from another_new_dir_renamed
Adding 1 OneDrive items for processing from asdfasdfasdf
Adding 1 OneDrive items for processing from different_set_of_data
Adding 1 OneDrive items for processing from new_directory
Finished processing self generated /delta JSON response from the OneDrive API
Processing 10 applicable JSON items received from Microsoft OneDrive
Processing OneDrive JSON item batch [1/1] to ensure consistent local state
Creating local directory: ./Folder1/Folder21/Jenkins/another_new_dir_renamed
Creating local directory: ./Folder1/Folder21/Jenkins/asdfasdfasdf
Creating local directory: ./Folder1/Folder21/Jenkins/different_set_of_data
Creating local directory: ./Folder1/Folder21/Jenkins/new_directory
Number of items to download from Microsoft OneDrive: 5
Downloading file: Folder1/Folder21/Jenkins/another_new_dir_renamed/asdfasdfasdfasdfasdf.txt ... done
Downloading file: Folder1/Folder21/Jenkins/new_directory/another_new_file.txt ... done
Downloading file: Folder1/Folder21/Jenkins/asdfasdfasdf/asdfasdfasd.txt ... done
Downloading file: Folder1/Folder21/Jenkins/newfile.txt ... done
Downloading file: Folder1/Folder21/Jenkins/different_set_of_data/file0.data ... done
Syncing this OneDrive Business Shared Folder: Folder1/Sub Folder 3
Generating a /delta response from the OneDrive API from this Drive ID: b!fZgJhK-pU0eTQpylvmoYCkE4YgH_KRNDlxjRx9OWNqmV9Q_E_uWdRJKIB5L_ruPN and Item ID: 01TZRSBFGHR2GGLPBAXNA33EUNO23MW3QE
Adding OneDrive folder details for processing
Adding 1 OneDrive items for processing from the OneDrive Shared Folder
Adding 5 OneDrive items for processing from awerqwerqwer
Finished processing self generated /delta JSON response from the OneDrive API
Processing 7 applicable JSON items received from Microsoft OneDrive
Processing OneDrive JSON item batch [1/1] to ensure consistent local state
Creating local directory: ./Sub Folder 3/awerqwerqwer
Number of items to download from Microsoft OneDrive: 5
Downloading file: Sub Folder 3/awerqwerqwer/file4.data ... done
Downloading file: Sub Folder 3/awerqwerqwer/file0.data ... done
Downloading file: Sub Folder 3/awerqwerqwer/file1.data ... done
Downloading file: Sub Folder 3/awerqwerqwer/file3.data ... done
Downloading file: Sub Folder 3/awerqwerqwer/file2.data ... done
Performing a database consistency and integrity check on locally stored data
Processing DB entries for this Drive ID: b!3Uyf_G4r-UKmoULFvShByvgolNg2SJRIhG4F_V15hB2En6zphwcvTJhA3eBRuImN
Processing: 3A
The directory has not changed
Processing: 3A
The directory has not changed
Processing: 3A/1
The directory has not changed
Processing: 3A/1/Document2.docx
The file has not changed
Processing: 3A/new_folder_1761
The directory has not changed
Processing: 3A/new_folder_1761/new_file_1761.txt
The file has not changed
Processing: 3A/new_folder_1761_folder2
The directory has not changed
Processing: 3A/new_folder_1761_folder2/new_file_1761_2.txt
The file has not changed
Processing: 3A/Presentation2.pptx
The file has not changed
Processing: 3A/new_file_shared_folder.txt
The file has not changed
Processing: 3A/another_new_file.txt
The file has not changed
Processing: 3A/debug_output.log
The file has not changed
Processing: 3A/Presentation.pptx
The file has not changed
Processing: 3A/Presentation5.pptx
The file has not changed
Processing: 3A/Presentation8.pptx
The file has not changed
Processing: 3A/Presentation3.pptx
The file has not changed
Processing: 3A/Presentation6.pptx
The file has not changed
Processing: 3A/Presentation7.pptx
The file has not changed
Processing: 3A/Presentation4.pptx
The file has not changed
Processing: 3A/Presentation9.pptx
The file has not changed
Processing: 3A/Remove Ubuntu Package.docx
The file has not changed
Processing: 3A/single-dir-new-file.txt
The file has not changed
Processing DB entries for this Drive ID: b!BhWyqa7K_kqXqHtSIlsqjR5iJogxpWxDradnpVGTU2VxBOJh82Y6S4he4rdnGPBT
WARNING: OneDrive quota information is being restricted. Please fix by speaking to your OneDrive / Office 365 Administrator.
Processing: Folder1/Folder21/Jenkins
The directory has not changed
Processing: Folder1/Folder21/Jenkins
The directory has not changed
Processing: Folder1/Folder21/Jenkins/another_new_dir_renamed
The directory has not changed
Processing: Folder1/Folder21/Jenkins/another_new_dir_renamed/asdfasdfasdfasdfasdf.txt
The file has not changed
Processing: Folder1/Folder21/Jenkins/asdfasdfasdf
The directory has not changed
Processing: Folder1/Folder21/Jenkins/asdfasdfasdf/asdfasdfasd.txt
The file has not changed
Processing: Folder1/Folder21/Jenkins/different_set_of_data
The directory has not changed
Processing: Folder1/Folder21/Jenkins/different_set_of_data/file0.data
The file has not changed
Processing: Folder1/Folder21/Jenkins/new_directory
The directory has not changed
Processing: Folder1/Folder21/Jenkins/new_directory/another_new_file.txt
The file has not changed
Processing: Folder1/Folder21/Jenkins/newfile.txt
The file has not changed
Processing DB entries for this Drive ID: b!DyXUf1m74EGNtZZj9Hzw3R_ccjiJb9xCvp-4dE_DvZIXUod3Az9ISaTJ7HbNvyDC
Processing: Documents - Issue_3020
The directory has not changed
Processing: Documents - Issue_3020/file_over_4Mb_3020
The directory has not changed
Processing: Documents - Issue_3020/file_over_4Mb_3020/file_over_4mb.docx
The file has not changed
Processing: Documents - Issue_3020/file_under_4Mb_3020
The directory has not changed
Processing: Documents - Issue_3020/file_under_4Mb_3020/file_under_4mb.docx
The file has not changed
Processing: Documents - Issue_3020/newfolder
The directory has not changed
Processing: Documents - Issue_3020/newfolder/newfile.txt
The file has not changed
Processing: Documents - Issue_3020/non_enrichment_over_4mb_3020
The directory has not changed
Processing: Documents - Issue_3020/non_enrichment_over_4mb_3020/file1.data
The file has not changed
Processing: Documents - Issue_3020/non_enrichment_under_4Mb_3020
The directory has not changed
Processing: Documents - Issue_3020/non_enrichment_under_4Mb_3020/file1.data
The file has not changed
Processing DB entries for this Drive ID: b!bO8V7s9SSk6r7mWHpIjURotN33W1W2tEv3OXV_oFIdQimEdOHR-1So7CqeT1MfHA
Processing: ~/OneDrive
The directory has not changed
Processing: L18N
The directory has not changed
Processing: L18N/α
The directory has not changed
Processing: L18N/เอกสาร
The directory has not changed
Processing: L18N/Bücher
The directory has not changed
Processing: bad_url_decode
The directory has not changed
Processing: bad_url_decode/BTINserye%20Anti-Terror%20Law%20sa%20Wikang%20Filipino%20-%2.mp4
The file has not changed
Processing: moved shared folder link
The directory has not changed
Processing: Notebooks
The directory has not changed
Processing: Notebooks/asdfasdfasdf
The directory has not changed
Processing: Issue 3057
The directory has not changed
Processing: Issue 3057/Presentation.pptx
The file has not changed
Processing: Issue 3057/Presentation1.pptx
The file has not changed
Processing: Folder1
The directory has not changed
Processing: Folder1/Folder21
The directory has not changed
Processing: Folder1/Folder21/Folder3
The directory has not changed
Processing: Folder1/Folder22
The directory has not changed
Processing DB entries for this Drive ID: b!fZgJhK-pU0eTQpylvmoYCkE4YgH_KRNDlxjRx9OWNqmV9Q_E_uWdRJKIB5L_ruPN
WARNING: OneDrive quota information is being restricted. Please fix by speaking to your OneDrive / Office 365 Administrator.
Processing: moved shared folder link/Sub Folder 2
The directory has not changed
Processing: moved shared folder link/Sub Folder 2
The directory has not changed
Processing: moved shared folder link/Sub Folder 2/online_folder_in_sub_folder2
The directory has not changed
Processing: moved shared folder link/Sub Folder 2/online_folder_in_sub_folder2/55_44_33_.trc
The file has not changed
Processing: moved shared folder link/Sub Folder 2/shared_folder_new_file.txt
The file has not changed
Processing: Sub Folder 3
The directory has not changed
Processing: Sub Folder 3/awerqwerqwer
The directory has not changed
Processing: Sub Folder 3/awerqwerqwer/file4.data
The file has not changed
Processing: Sub Folder 3/awerqwerqwer/file0.data
The file has not changed
Processing: Sub Folder 3/awerqwerqwer/file1.data
The file has not changed
Processing: Sub Folder 3/awerqwerqwer/file3.data
The file has not changed
Processing: Sub Folder 3/awerqwerqwer/file2.data
The file has not changed
Scanning the local file system '~/OneDrive' for new data to upload
Performing a last examination of the most recent online data within Microsoft OneDrive to complete the reconciliation process
Fetching /delta response from the OneDrive API for Drive ID: b!bO8V7s9SSk6r7mWHpIjURotN33W1W2tEv3OXV_oFIdQimEdOHR-1So7CqeT1MfHA
Processing API Response Bundle: 1 - Quantity of 'changes|items' in this bundle to process: 0
Finished processing /delta JSON response from the OneDrive API
No changes or items that can be applied were discovered while processing the data received from Microsoft OneDrive
Syncing this OneDrive Business Shared Folder: test_folder_in_3040

WARNING: The OneDrive Shared Folder link target 'test_folder_in_3040' cannot be found online using the provided online data.
WARNING: This is potentially a broken online OneDrive Shared Folder link or you no longer have access to it. Please correct this error online.

No changes or items that can be applied were discovered while processing the data received from Microsoft OneDrive
Syncing this OneDrive Business Shared Folder: moved shared folder link/Sub Folder 2
Generating a /delta response from the OneDrive API from this Drive ID: b!fZgJhK-pU0eTQpylvmoYCkE4YgH_KRNDlxjRx9OWNqmV9Q_E_uWdRJKIB5L_ruPN and Item ID: 01TZRSBFDUQZAUOGZ7BJGZ24DDTBCLCGWI
Adding OneDrive folder details for processing
Adding 2 OneDrive items for processing from the OneDrive Shared Folder
Adding 1 OneDrive items for processing from online_folder_in_sub_folder2
Finished processing self generated /delta JSON response from the OneDrive API
Processing 4 applicable JSON items received from Microsoft OneDrive
Processing OneDrive JSON item batch [1/1] to ensure consistent local state
Syncing this OneDrive Business Shared Folder: Documents - Issue_3020
Generating a /delta response from the OneDrive API from this Drive ID: b!DyXUf1m74EGNtZZj9Hzw3R_ccjiJb9xCvp-4dE_DvZIXUod3Az9ISaTJ7HbNvyDC and Item ID: 01D3ZRYZV6Y2GOVW7725BZO354PWSELRRZ
Adding OneDrive folder details for processing
Adding 5 OneDrive items for processing from the OneDrive Shared Folder
Adding 1 OneDrive items for processing from file_over_4Mb_3020
Adding 1 OneDrive items for processing from file_under_4Mb_3020
Adding 1 OneDrive items for processing from newfolder
Adding 1 OneDrive items for processing from non_enrichment_over_4mb_3020
Adding 1 OneDrive items for processing from non_enrichment_under_4Mb_3020
Finished processing self generated /delta JSON response from the OneDrive API
Processing 10 applicable JSON items received from Microsoft OneDrive
Processing OneDrive JSON item batch [1/1] to ensure consistent local state
Syncing this OneDrive Business Shared Folder: 3A
Generating a /delta response from the OneDrive API from this Drive ID: b!3Uyf_G4r-UKmoULFvShByvgolNg2SJRIhG4F_V15hB2En6zphwcvTJhA3eBRuImN and Item ID: 01Q5HFMF5FR4UZ3S52WBBY2FODXG7JRIVB
Adding OneDrive folder details for processing
Adding 17 OneDrive items for processing from the OneDrive Shared Folder
Adding 1 OneDrive items for processing from 1
Adding 1 OneDrive items for processing from new_folder_1761
Adding 1 OneDrive items for processing from new_folder_1761_folder2
Finished processing self generated /delta JSON response from the OneDrive API
Processing 21 applicable JSON items received from Microsoft OneDrive
Processing OneDrive JSON item batch [1/1] to ensure consistent local state
Syncing this OneDrive Business Shared Folder: Folder1/Folder21/Jenkins
Generating a /delta response from the OneDrive API from this Drive ID: b!BhWyqa7K_kqXqHtSIlsqjR5iJogxpWxDradnpVGTU2VxBOJh82Y6S4he4rdnGPBT and Item ID: 01FBLR4V3MQE5SZJQROFGZXLDYVJ5LY7NM
Adding OneDrive folder details for processing
Adding 5 OneDrive items for processing from the OneDrive Shared Folder
Adding 1 OneDrive items for processing from another_new_dir_renamed
Adding 1 OneDrive items for processing from asdfasdfasdf
Adding 1 OneDrive items for processing from different_set_of_data
Adding 1 OneDrive items for processing from new_directory
Finished processing self generated /delta JSON response from the OneDrive API
Processing 10 applicable JSON items received from Microsoft OneDrive
Processing OneDrive JSON item batch [1/1] to ensure consistent local state
Syncing this OneDrive Business Shared Folder: Folder1/Sub Folder 3
Generating a /delta response from the OneDrive API from this Drive ID: b!fZgJhK-pU0eTQpylvmoYCkE4YgH_KRNDlxjRx9OWNqmV9Q_E_uWdRJKIB5L_ruPN and Item ID: 01TZRSBFGHR2GGLPBAXNA33EUNO23MW3QE
Adding OneDrive folder details for processing
Adding 1 OneDrive items for processing from the OneDrive Shared Folder
Adding 5 OneDrive items for processing from awerqwerqwer
Finished processing self generated /delta JSON response from the OneDrive API
Processing 7 applicable JSON items received from Microsoft OneDrive
Processing OneDrive JSON item batch [1/1] to ensure consistent local state

Sync with Microsoft OneDrive is complete
Attempting to perform a database vacuum to optimise database
Database vacuum is complete

Local File State

.
├── 3A
│   ├── 1
│   │   └── Document2.docx
│   ├── another_new_file.txt
│   ├── debug_output.log
│   ├── new_file_shared_folder.txt
│   ├── new_folder_1761
│   │   └── new_file_1761.txt
│   ├── new_folder_1761_folder2
│   │   └── new_file_1761_2.txt
│   ├── Presentation2.pptx
│   ├── Presentation3.pptx
│   ├── Presentation4.pptx
│   ├── Presentation5.pptx
│   ├── Presentation6.pptx
│   ├── Presentation7.pptx
│   ├── Presentation8.pptx
│   ├── Presentation9.pptx
│   ├── Presentation.pptx
│   ├── Remove Ubuntu Package.docx
│   └── single-dir-new-file.txt
├── bad_url_decode
│   └── BTINserye%20Anti-Terror%20Law%20sa%20Wikang%20Filipino%20-%2.mp4
├── Documents - Issue_3020
│   ├── file_over_4Mb_3020
│   │   └── file_over_4mb.docx
│   ├── file_under_4Mb_3020
│   │   └── file_under_4mb.docx
│   ├── newfolder
│   │   └── newfile.txt
│   ├── non_enrichment_over_4mb_3020
│   │   └── file1.data
│   └── non_enrichment_under_4Mb_3020
│       └── file1.data
├── Folder1
│   ├── Folder21
│   │   ├── Folder3
│   │   └── Jenkins
│   │       ├── another_new_dir_renamed
│   │       │   └── asdfasdfasdfasdfasdf.txt
│   │       ├── asdfasdfasdf
│   │       │   └── asdfasdfasd.txt
│   │       ├── different_set_of_data
│   │       │   └── file0.data
│   │       ├── new_directory
│   │       │   └── another_new_file.txt
│   │       └── newfile.txt
│   ├── Folder22
│   └── Sub Folder 3
├── Issue 3057
│   ├── Presentation1.pptx
│   └── Presentation.pptx
├── L18N
│   ├── Bücher
│   ├── α
│   └── เอกสาร
├── moved shared folder link
│   └── Sub Folder 2
│       ├── online_folder_in_sub_folder2
│       │   └── 55_44_33_.trc
│       └── shared_folder_new_file.txt
├── Notebooks
│   └── asdfasdfasdf
├── Sub Folder 3
│   └── awerqwerqwer
│       ├── file0.data
│       ├── file1.data
│       ├── file2.data
│       ├── file3.data
│       └── file4.data
└── test_folder_in_3040

35 directories, 37 files

Note

I did delete everything in the local folder before the run of the application using --sync --resync

@abraunegg
Copy link
Owner

@divico

Another thing to think about: Moving the shared folder on the local file system and then running --sync will silently (in case one is not reading the verbose log output) delete the shared folder on OneDrive, create a regular folder on OneDrive at the new location and copy all files into that new folder. This could be misleading as the user may think they are still working on shared files which is not the case anymore. If it is technically too difficult to implement two-way moving of shared folders, I would suggest not letting the user move shared folders from local to OneDrive and throw an error message instead

Unfortunately nothing can be done in this regards.

Why - the local move is happening on the Linux filesystem. The move has already been completed locally before the inotify events are sent by the filesystem and read by the client when using --monitor mode. It is even more of an issue when using standalone (--sync) mode as this is reading what is on the local disk in the location where it is.

It has to be user beware here unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants