From 4f501b4aafe8960da825cc1da7a86cc7fff197b5 Mon Sep 17 00:00:00 2001 From: abraunegg Date: Mon, 29 Sep 2025 17:03:14 +1000 Subject: [PATCH] Fix Bug #3451: Ensure driveId target is cached (#3454) * Ensure that the driveId of a modified file that is to be uploaded to, exists in the cached array --- src/sync.d | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/sync.d b/src/sync.d index 6cc5c11c..91b26bb2 100644 --- a/src/sync.d +++ b/src/sync.d @@ -6452,13 +6452,23 @@ class SyncEngine { targetItemId = changedItemId; } } - + // Fetch the details from cachedOnlineDriveData if this is available // - cachedOnlineDriveData.quotaRestricted; // - cachedOnlineDriveData.quotaAvailable; // - cachedOnlineDriveData.quotaRemaining; DriveDetailsCache cachedOnlineDriveData; + // Make sure that parentItem.driveId is in our driveIDs array to use when checking if item is in database + // Keep the DriveDetailsCache array with unique entries only + if (!canFindDriveId(targetDriveId, cachedOnlineDriveData)) { + // Add this driveId to the drive cache, which then also sets for the defaultDriveId: + // - quotaRestricted; + // - quotaAvailable; + // - quotaRemaining; + addOrUpdateOneDriveOnlineDetails(targetDriveId); + } + // Query the details using the correct 'targetDriveId' for this modified file to be uploaded cachedOnlineDriveData = getDriveDetails(targetDriveId);