You've already forked joplin
							
							
				mirror of
				https://github.com/laurent22/joplin.git
				synced 2025-10-31 00:07:48 +02:00 
			
		
		
		
	All: Fixes #2091: Handle WebDAV servers that do not return a last modified date (fixes mail.ru)
This commit is contained in:
		| @@ -195,6 +195,8 @@ class WebDavApi { | ||||
| 		} | ||||
|  | ||||
| 		if (outputType === 'string') { | ||||
| 			if (!output) throw new JoplinError(`String property not found: ${propName}: ${JSON.stringify(resource)}`, 'stringNotFound'); | ||||
|  | ||||
| 			// If the XML has not attribute the value is directly a string | ||||
| 			// If the XML node has attributes, the value is under "_". | ||||
| 			// Eg for this XML, the string will be under {"_":"Thu, 01 Feb 2018 17:24:05 GMT"}: | ||||
|   | ||||
| @@ -55,6 +55,8 @@ shared.checkSyncConfigMessages = function(comp) { | ||||
| }; | ||||
|  | ||||
| shared.checkNextcloudApp = async function(comp, settings) { | ||||
| 	if (settings['sync.target'] !== 5) return; | ||||
|  | ||||
| 	comp.setState({ checkNextcloudAppResult: 'checking' }); | ||||
| 	let result = null; | ||||
| 	const appApi = await reg.syncTargetNextcloud().appApi(); | ||||
|   | ||||
| @@ -58,7 +58,17 @@ class FileApiDriverWebDav { | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
| 		const lastModifiedString = this.api().resourcePropByName(resource, 'string', 'd:getlastmodified'); | ||||
| 		let lastModifiedString = null; | ||||
|  | ||||
| 		try { | ||||
| 			lastModifiedString = this.api().resourcePropByName(resource, 'string', 'd:getlastmodified'); | ||||
| 		} catch (error) { | ||||
| 			if (error.code === 'stringNotFound') { | ||||
| 				// OK - the logic to handle this is below | ||||
| 			} else { | ||||
| 				throw error; | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
| 		// Note: Not all WebDAV servers return a getlastmodified date (eg. Seafile, which doesn't return the | ||||
| 		// property for folders) so we can only throw an error if it's a file. | ||||
|   | ||||
		Reference in New Issue
	
	Block a user