You've already forked joplin
							
							
				mirror of
				https://github.com/laurent22/joplin.git
				synced 2025-10-31 00:07:48 +02:00 
			
		
		
		
	All: Fixed sync issue and database migration issue
This commit is contained in:
		| @@ -205,7 +205,9 @@ class JoplinDatabase extends Database { | ||||
| 		const existingDatabaseVersions = [0, 1, 2, 3, 4, 5, 6, 7]; | ||||
|  | ||||
| 		let currentVersionIndex = existingDatabaseVersions.indexOf(fromVersion); | ||||
| 		if (currentVersionIndex == existingDatabaseVersions.length - 1) return false; | ||||
| 		// currentVersionIndex < 0 if for the case where an old version of Joplin used with a newer | ||||
| 		// version of the database, so that migration is not run in this case. | ||||
| 		if (currentVersionIndex == existingDatabaseVersions.length - 1 || currentVersionIndex < 0) return false; | ||||
| 		 | ||||
| 		while (currentVersionIndex < existingDatabaseVersions.length - 1) { | ||||
| 			const targetVersion = existingDatabaseVersions[currentVersionIndex + 1]; | ||||
|   | ||||
| @@ -421,6 +421,9 @@ class Synchronizer { | ||||
| 						let ItemClass = BaseItem.itemClass(content); | ||||
| 						content = ItemClass.filter(content); | ||||
|  | ||||
| 						if (!content.user_updated_time) content.user_updated_time = content.updated_time; | ||||
| 						if (!content.user_created_time) content.user_created_time = content.created_time; | ||||
|  | ||||
| 						let newContent = null; | ||||
|  | ||||
| 						if (action === 'createLocal') { | ||||
| @@ -445,9 +448,6 @@ class Synchronizer { | ||||
| 							await this.api().get(remoteResourceContentPath, { path: localResourceContentPath, target: 'file' }); | ||||
| 						} | ||||
|  | ||||
| 						if (!newContent.user_updated_time) newContent.user_updated_time = newContent.updated_time; | ||||
| 						if (!newContent.user_created_time) newContent.user_created_time = newContent.created_time; | ||||
|  | ||||
| 						await ItemClass.save(newContent, options); | ||||
|  | ||||
| 					} else if (action == 'deleteLocal') { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user