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
This commit is contained in:
abraunegg 2025-09-29 17:03:14 +10:00 committed by GitHub
commit 4f501b4aaf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);