Fix Bug #3479: Fix missing user information when syncing shared files (#3483)

* fix: database inconsistency due to unassigned variable

* fix: more debug logging, setting sharedByFolderName to Email as fallback

---------

Co-authored-by: Daniel Schiffner <d.schiffner@dipf.de>
Co-authored-by: abraunegg <alex.braunegg@gmail.com>
This commit is contained in:
Daniel 2025-10-18 21:28:09 +02:00 committed by GitHub
commit a2d1a7cd49
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -14191,13 +14191,18 @@ class SyncEngine {
sharedByFolderName = sharedByName ~ " (" ~ sharedByEmail ~ ")";
} else {
if (debugLogging) {addLogEntry("Either name or email is not defined -> check specifically. Currently: " ~ to!string(sharedByName) ~ " / " ~ to!string(sharedByEmail), ["debug"]);}
if (sharedByName != "") {
sharedByFolderName = sharedByName;
} else {
sharedByFolderName = sharedByEmail;
}
}
if (debugLogging) {addLogEntry("Combined folder set to " ~ to!string(sharedByFolderName), ["debug"]);}
// Create the local path to store this users shared files with us
newLocalSharedFilePath = buildNormalizedPath(buildPath(appConfig.configuredBusinessSharedFilesDirectoryName, sharedByFolderName));
if (debugLogging) {addLogEntry("newLocalSharedFilePath is located at " ~ to!string(newLocalSharedFilePath), ["debug"]);}
// Does the Shared File Users Local Directory to store the shared file(s) exist?
if (!exists(newLocalSharedFilePath)) {
@ -14230,6 +14235,10 @@ class SyncEngine {
// Add DB record to the local database
if (debugLogging) {addLogEntry("Creating|Updating into local database a DB record for storing OneDrive Business Shared Files: " ~ to!string(sharedFilesPath), ["debug"]);}
itemDB.upsert(sharedFilesPath);
} else {
// If the folder exists in the db, assign the variable to have the parentID available
sharedFilesPath = dbRecord;
if (debugLogging) {addLogEntry("Recreating local database record for storing OneDrive Business Shared Files: " ~ to!string(sharedFilesPath), ["debug"]);}
}
}