Skip to content

Commit

Permalink
Fix that the root Personal Shared Folder is not handled due to missin…
Browse files Browse the repository at this point in the history
…g API data

* Handle the 'root' folder of a OneDrive Personal Shared Folder in a more direct manner due to OneDrive API inconsistency in European Data Centres
  • Loading branch information
abraunegg committed Dec 13, 2024
1 parent c7af218 commit 627dcfe
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/sync.d
Original file line number Diff line number Diff line change
Expand Up @@ -1691,6 +1691,7 @@ class SyncEngine {
// Personal Account Handling
if (debugLogging) {addLogEntry("Handling a Personal Shared Item JSON object", ["debug"]);}

// Does the JSON have a shared element structure
if (hasSharedElement(onedriveJSONItem)) {
// Has the Shared JSON structure
if (debugLogging) {addLogEntry("Personal Shared Item JSON object has the 'shared' JSON structure", ["debug"]);}
Expand All @@ -1699,11 +1700,13 @@ class SyncEngine {
}

// Ensure that this item has no parent
if (debugLogging) {addLogEntry("Setting remoteItem.parentId to be null", ["debug"]);}
if (debugLogging) {addLogEntry("Setting remoteItem.parentId of Personal Shared Item JSON object to be null", ["debug"]);}
remoteItem.parentId = null;
// Add this record to the local database
if (debugLogging) {addLogEntry("Update/Insert local database with remoteItem details with remoteItem.parentId as null: " ~ to!string(remoteItem), ["debug"]);}
if (debugLogging) {addLogEntry("Update/Insert local database with Personal Shared Item JSON object with remoteItem.parentId as null: " ~ to!string(remoteItem), ["debug"]);}
itemDB.upsert(remoteItem);
// Due to OneDrive API inconsistency, again with European Data Centres, as we have handled this JSON - flag as unwanted as processing is complete for this JSON item
unwanted = true;
} else {
// Business or SharePoint Account Handling
if (debugLogging) {addLogEntry("Handling a Business or SharePoint Shared Item JSON object", ["debug"]);}
Expand Down Expand Up @@ -2041,7 +2044,7 @@ class SyncEngine {
// We know if this JSON item is unwanted or not
if (unwanted) {
// This JSON item is NOT wanted - it is excluded
if (debugLogging) {addLogEntry("Skipping OneDrive change as this is determined to be unwanted", ["debug"]);}
if (debugLogging) {addLogEntry("Skipping OneDrive change as this is determined to be unwanted either through Client Side Filtering Rules or prior processing to this point", ["debug"]);}

// Add to the skippedItems array, but only if it is a directory ... pointless adding 'files' here, as it is the 'id' we check as the parent path which can only be a directory
if (!isItemFile(onedriveJSONItem)) {
Expand Down

0 comments on commit 627dcfe

Please sign in to comment.