Skip to content

Commit 7bc4266

Browse files
authored
Fix Bug #3414: Fix SharePoint Shared Library DB Tie creation (#3419)
* Fix SharePoint Shared Library DB Tie creation
1 parent 37ba8cc commit 7bc4266

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

src/itemdb.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,7 @@ final class ItemDatabase {
998998
anchorCandidateItemId = item.id;
999999
}
10001000

1001-
// Build path (your existing behaviour)
1001+
// Build path: Skip only if name == "root" AND item.type == ItemType.root
10021002
const bool skipAppend = (item.name == "root") && (item.type == ItemType.root);
10031003
if (!skipAppend) {
10041004
if (item.type == ItemType.remote) {

src/sync.d

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1614,6 +1614,10 @@ class SyncEngine {
16141614
if (debugLogging) {
16151615
addLogEntry("Number of JSON items to process is: " ~ to!string(jsonItemsToProcess.length), ["debug"]);
16161616
addLogEntry("Number of JSON items processed was: " ~ to!string(processedCount), ["debug"]);
1617+
addLogEntry("", ["debug"]);
1618+
string jsonProcessingCompleteLineEntry = format("Processing of JSON items from driveId %s and itemId %s is complete", driveIdToQuery, itemIdToQuery);
1619+
addLogEntry(jsonProcessingCompleteLineEntry, ["debug"]);
1620+
addLogEntry("", ["debug"]);
16171621
}
16181622

16191623
// Notification to user regarding number of objects received from OneDrive API
@@ -1706,7 +1710,7 @@ class SyncEngine {
17061710
// This is not a deleted item
17071711
if (debugLogging) {addLogEntry("This item is not a OneDrive online deletion change", ["debug"]);}
17081712

1709-
// Only calculate this once
1713+
// Only calculate these elements once
17101714
itemIsRoot = isItemRoot(onedriveJSONItem);
17111715
itemHasParentReferenceId = hasParentReferenceId(onedriveJSONItem);
17121716
itemIdMatchesDefaultRootId = (thisItemId == appConfig.defaultRootId);
@@ -2628,12 +2632,17 @@ class SyncEngine {
26282632

26292633
// Attempt to apply this changed item
26302634
applyPotentiallyChangedItem(existingDatabaseItem, existingItemPath, newDatabaseItem, newItemPath, onedriveJSONItem);
2635+
2636+
// Is this JSON object a 'remote' item?
2637+
if(isItemRemote(onedriveJSONItem)) {
2638+
// Create a 'root' and 'Shared Folder' DB Tie Records for this JSON object in a consistent manner
2639+
createRequiredSharedFolderDatabaseRecords(onedriveJSONItem);
2640+
}
26312641
} else {
26322642
// Action this JSON item as a new item as we have no DB record of it
26332643
// The actual item may actually exist locally already, meaning that just the database is out-of-date or missing the data due to --resync
26342644
// But we also cannot compute the newItemPath as the parental objects may not exist as well
26352645
if (debugLogging) {addLogEntry("OneDrive JSON item is potentially a new local item", ["debug"]);}
2636-
26372646
// Attempt to apply this potentially new item
26382647
applyPotentiallyNewLocalItem(newDatabaseItem, onedriveJSONItem, newItemPath);
26392648
}
@@ -10654,7 +10663,7 @@ class SyncEngine {
1065410663

1065510664
// What 'driveData' are we adding?
1065610665
if (debugLogging) {
10657-
addLogEntry("adding this 'driveData' to childrenData = " ~ to!string(driveData), ["debug"]);
10666+
addLogEntry("Adding this 'driveData' to childrenData = " ~ to!string(driveData), ["debug"]);
1065810667
}
1065910668

1066010669
// add the responded 'driveData' to the childrenData to process later

0 commit comments

Comments
 (0)