mirror of
https://github.com/abraunegg/onedrive
synced 2026-03-14 14:35:46 +01:00
Fix foreign key issue when performing a --resync (#3383)
* Fix foreign key issue when performing a --resync due to a missed conversion of driveId to lowercase values (#3336) and path is covered by 'sync_list' entries
This commit is contained in:
parent
4283e95f16
commit
6248f27b87
2 changed files with 11 additions and 7 deletions
|
|
@ -519,7 +519,7 @@ final class ItemDatabase {
|
|||
|
||||
try {
|
||||
if (debugLogging) {
|
||||
addLogEntry("Attempting upsert for item: id='" ~ item.id ~ "', parentId='" ~ item.parentId ~ "', name='" ~ item.name ~ "'", ["debug"]);
|
||||
addLogEntry("Attempting upsert for item: driveId='" ~ item.driveId ~ "', id='" ~ item.id ~ "', parentId='" ~ item.parentId ~ "', name='" ~ item.name ~ "'", ["debug"]);
|
||||
}
|
||||
|
||||
selectStmt.bind(1, item.driveId);
|
||||
|
|
@ -541,7 +541,7 @@ final class ItemDatabase {
|
|||
if (orphanCount == 0) {
|
||||
// No match on name+parentId either — new insert
|
||||
if (debugLogging) {
|
||||
addLogEntry("Inserting new item: id='" ~ item.id ~ "', parentId='" ~ item.parentId ~ "', name='" ~ item.name ~ "'", ["debug"]);
|
||||
addLogEntry("Inserting new item: driveId='" ~ item.driveId ~ "', id='" ~ item.id ~ "', parentId='" ~ item.parentId ~ "', name='" ~ item.name ~ "'", ["debug"]);
|
||||
}
|
||||
executionStmt = db.prepare(insertItemStmt);
|
||||
} else {
|
||||
|
|
|
|||
14
src/sync.d
14
src/sync.d
|
|
@ -10160,18 +10160,22 @@ class SyncEngine {
|
|||
// Issue #3115 - Personal Account Shared Folder
|
||||
// What account type is this?
|
||||
if (appConfig.accountType == "personal") {
|
||||
// Issue #3336 - Convert driveId to lowercase for the DB record
|
||||
string actualOnlineDriveId = testProvidedDriveIdForLengthIssue(fetchRealOnlineDriveIdentifier(newDatabaseItem.driveId));
|
||||
newDatabaseItem.driveId = actualOnlineDriveId;
|
||||
|
||||
// Is this a 'remote' DB record
|
||||
if (newDatabaseItem.type == ItemType.remote) {
|
||||
// Issue #3336 - Convert driveId to lowercase before any test
|
||||
// Issue #3336 - Convert remoteDriveId to lowercase before any test
|
||||
newDatabaseItem.remoteDriveId = transformToLowerCase(newDatabaseItem.remoteDriveId);
|
||||
|
||||
// Test driveId length and validation if the driveId we are testing is not equal to appConfig.defaultDriveId
|
||||
// Test remoteDriveId length and validation if the remoteDriveId we are testing is not equal to appConfig.defaultDriveId
|
||||
if (newDatabaseItem.remoteDriveId != appConfig.defaultDriveId) {
|
||||
// Issue #3136, #3139 #3143
|
||||
// Fetch the actual online record for this item
|
||||
// This returns the actual OneDrive Personal driveId value and is 15 character checked
|
||||
string actualOnlineDriveId = testProvidedDriveIdForLengthIssue(fetchRealOnlineDriveIdentifier(newDatabaseItem.remoteDriveId));
|
||||
newDatabaseItem.remoteDriveId = actualOnlineDriveId;
|
||||
// This returns the actual OneDrive Personal remoteDriveId value and is 15 character checked
|
||||
string actualOnlineRemoteDriveId = testProvidedDriveIdForLengthIssue(fetchRealOnlineDriveIdentifier(newDatabaseItem.remoteDriveId));
|
||||
newDatabaseItem.remoteDriveId = actualOnlineRemoteDriveId;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue