@@ -3196,7 +3196,20 @@ class SyncEngine {
3196
3196
3197
3197
// Is the last modified timestamp in the DB the same as the API data or are we running an operational mode where we simulated the /delta response?
3198
3198
if ((existingItemModifiedTime != changedOneDriveItemModifiedTime) || (generateSimulatedDeltaResponse)) {
3199
- // Save this item in the database
3199
+ // Save this item in the database
3200
+
3201
+ // Issue #3115 - Personal Account Shared Folder
3202
+ // What account type is this?
3203
+ if (appConfig.accountType == "personal") {
3204
+ // Is this a 'remote' DB record
3205
+ if (changedOneDriveItem.type == ItemType.remote) {
3206
+ // Fetch the actual online record for this item
3207
+ // This returns the actual OneDrive Personal driveId value and is 15 character checked
3208
+ string actualOnlineDriveId = fetchRealOnlineDriveIdentifier(changedOneDriveItem.remoteDriveId);
3209
+ changedOneDriveItem.remoteDriveId = actualOnlineDriveId;
3210
+ }
3211
+ }
3212
+
3200
3213
// Add to the local database
3201
3214
if (debugLogging) {addLogEntry("Adding changed OneDrive Item to database: " ~ to!string(changedOneDriveItem), ["debug"]);}
3202
3215
itemDB.upsert(changedOneDriveItem);
@@ -3231,6 +3244,19 @@ class SyncEngine {
3231
3244
// Is the last modified timestamp in the DB the same as the API data or are we running an operational mode where we simulated the /delta response?
3232
3245
if ((existingItemModifiedTime != changedOneDriveItemModifiedTime) || (generateSimulatedDeltaResponse)) {
3233
3246
// Database update needed for this item because our local record is out-of-date
3247
+
3248
+ // Issue #3115 - Personal Account Shared Folder
3249
+ // What account type is this?
3250
+ if (appConfig.accountType == "personal") {
3251
+ // Is this a 'remote' DB record
3252
+ if (changedOneDriveItem.type == ItemType.remote) {
3253
+ // Fetch the actual online record for this item
3254
+ // This returns the actual OneDrive Personal driveId value and is 15 character checked
3255
+ string actualOnlineDriveId = fetchRealOnlineDriveIdentifier(changedOneDriveItem.remoteDriveId);
3256
+ changedOneDriveItem.remoteDriveId = actualOnlineDriveId;
3257
+ }
3258
+ }
3259
+
3234
3260
// Add to the local database
3235
3261
if (debugLogging) {addLogEntry("Adding changed OneDrive Item to database: " ~ to!string(changedOneDriveItem), ["debug"]);}
3236
3262
itemDB.upsert(changedOneDriveItem);
@@ -4090,7 +4116,10 @@ class SyncEngine {
4090
4116
}
4091
4117
4092
4118
// What driveID and itemID we trying to calculate the path for
4093
- if (debugLogging) {addLogEntry("Attempting to calculate initial local filesystem path for " ~ thisDriveId ~ " and " ~ thisItemId, ["debug"]);}
4119
+ if (debugLogging) {
4120
+ string initialComputeLogMessage = format("Attempting to calculate initial local filesystem path for '%s' and '%s'", thisDriveId, thisItemId);
4121
+ addLogEntry(initialComputeLogMessage, ["debug"]);
4122
+ }
4094
4123
4095
4124
// Perform the original calculation of the path using the values provided
4096
4125
try {
@@ -4119,7 +4148,7 @@ class SyncEngine {
4119
4148
string fullLocalPath;
4120
4149
string localPathExtension;
4121
4150
4122
- if (debugLogging) {addLogEntry("Attempting to calculate shared folder local filesystem path for " ~ thisDriveId ~ " and " ~ thisItemId, ["debug"]);}
4151
+ if (debugLogging) {addLogEntry("Attempting to calculate Shared Folder local filesystem path for " ~ thisDriveId ~ " and " ~ thisItemId, ["debug"]);}
4123
4152
4124
4153
// Get the DB entry for this 'remote' item
4125
4154
itemDB.selectRemoteTypeByRemoteDriveId(thisDriveId, thisItemId, remoteEntryItem);
@@ -9234,6 +9263,12 @@ class SyncEngine {
9234
9263
logKey = generateAlphanumericString();
9235
9264
displayFunctionProcessingStart(thisFunctionName, logKey);
9236
9265
}
9266
+
9267
+ // What are we doing
9268
+ if (debugLogging) {
9269
+ string fetchRealValueLogMessage = format("Fetching actual online 'driveId' value for '%s'", inputDriveId);
9270
+ addLogEntry(fetchRealValueLogMessage, ["debug"]);
9271
+ }
9237
9272
9238
9273
// variables for this function
9239
9274
JSONValue remoteDriveDetails;
@@ -9387,6 +9422,15 @@ class SyncEngine {
9387
9422
searchItem.driveId = pathData["remoteItem"]["parentReference"]["driveId"].str;
9388
9423
searchItem.id = pathData["remoteItem"]["id"].str;
9389
9424
remotePathObject = true;
9425
+
9426
+ // Issue #3115 - Personal Account Shared Folder
9427
+ // What account type is this?
9428
+ if (appConfig.accountType == "personal") {
9429
+ // Fetch the actual online record for this item
9430
+ // This returns the actual OneDrive Personal driveId value and is 15 character checked
9431
+ string actualOnlineDriveId = fetchRealOnlineDriveIdentifier(searchItem.driveId);
9432
+ searchItem.driveId = actualOnlineDriveId;
9433
+ }
9390
9434
}
9391
9435
} catch (OneDriveException exception) {
9392
9436
// Display error message
0 commit comments