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

Fix Bug #3115: Add further driveId length checks when generating a /delta response for a Shared Folder #3116

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

abraunegg
Copy link
Owner

  • Add further personal account driveId length checks when generating a /delta response for a Shared Folder

* Add further personal account driveId length checks when generating a /delta response for a Shared Folder
@abraunegg abraunegg added this to the v2.5.5 milestone Feb 12, 2025
@abraunegg abraunegg changed the title Add further driveId length checks when generating a /delta response for a Shared Folder Fix Issue #3115: Add further driveId length checks when generating a /delta response for a Shared Folder Feb 13, 2025
@abraunegg abraunegg changed the title Fix Issue #3115: Add further driveId length checks when generating a /delta response for a Shared Folder Fix Bug #3115: Add further driveId length checks when generating a /delta response for a Shared Folder Feb 13, 2025
* Fix selectRemoteTypeByRemoteDriveId() function to also use the remote item id so that the correct DB record is responded with. This ensures that 'localPathExtension =' reflects the correct local path extension and not some other incorrect local path
* If the 'shared' JSON structure is missing, add a debug message
* Update PR
* Revert selectRemoteTypeByRemoteDriveId change as this impacts Business Shared Folders
@murraybo
Copy link

I do have the issue you try to solve here, too.

The current version of the pull request does not fix it. It still brakes during sync.

One thing that i identified, was that the item id, which contains the drive id, need to be adjusted, too. I hacked this by adding a function:

string testProvidedItemIdForLengthIssue(string objectParentDriveId) {
     auto o = objectParentDriveId.split("!");
     
     string newEntry;
     
     newEntry = to!string(o[0].padLeft('0', 16));
     newEntry = newEntry ~ "!" ~ o[1];

     return newEntry;
 }

and calling it at sync.d:9186

image

This allowed me to continue in syncing the shared drive. Nevertheless it broke later due to missing entries in itemdb.

DEBUG: ONEDRIVE PERSONAL API BUG: The provided online ['parentReference']['driveId'] value is not 16 Characters in length - padding with leading zero's
DEBUG:  - old 'driveId' value = 65fb7c645f8339c
DEBUG:  - new 'driveId' value = 065fb7c645f8339c
DEBUG: Attempting to calculate initial local filesystem path for 065fb7c645f8339c and 065FB7C645F8339C!448
DEBUG: The following generated a broken database tree query:
DEBUG: Drive ID: 065fb7c645f8339c
DEBUG: Item ID: 065FB7C645F8339C!448
DEBUG: ERROR: A database consistency issue has been caught. A --resync is needed to rebuild the database.

At that point the relevant db entries looked like this

sqlite> select * from item where driveId = '65fb7c645f8339c';
65fb7c645f8339c|65FB7C645F8339C!448|...||root|...|...|2021-01-24T11:28:53.296Z|||||||||Y|
65fb7c645f8339c|065FB7C645F8339C!448|...||dir|...|...|2021-01-24T11:28:53.296Z|||||||||Y|
sqlite> 

@abraunegg This is, as far as i got on this afternoon, I hope this helps you to fix the issue.

BTW: Thanks for this create tool and the work you put into it.

@abraunegg
Copy link
Owner Author

@murraybo
Unfortunately The 'item id' being 15 characters, whilst technically is not correct (it should also be 16 characters) is not the root cause of the issue.

As you can reproduce this issue, please can you urgently send me via email a complete, un-redacted verbose debug log using this PR in its current state.

Please read https://github.com/abraunegg/onedrive/wiki/Generate-https-debug-log-for-support#standalone-mode to generate this log

* Add further checks for invalid 15 character driveId when creating Shared Folder references
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Application crash when calculating path due to 15 character driveId API bug
2 participants