mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-04 05:28:59 +01:00 
			
		
		
		
	fixed false sync error reporting
This commit is contained in:
		
							parent
							
								
									fc6669d254
								
							
						
					
					
						commit
						af529f82e5
					
				@ -16,8 +16,11 @@ const RecentNote = require('../entities/recent_note');
 | 
			
		||||
const Option = require('../entities/option');
 | 
			
		||||
 | 
			
		||||
async function getHash(entityConstructor, whereBranch) {
 | 
			
		||||
    let contentToHash = await sql.getValue(`SELECT GROUP_CONCAT(hash) FROM ${entityConstructor.tableName} `
 | 
			
		||||
                + (whereBranch ? `WHERE ${whereBranch} ` : '') + `ORDER BY ${entityConstructor.primaryKeyName}`);
 | 
			
		||||
    // subselect is necessary to have correct ordering in GROUP_CONCAT
 | 
			
		||||
    const query = `SELECT GROUP_CONCAT(hash) FROM (SELECT hash FROM ${entityConstructor.tableName} `
 | 
			
		||||
        + (whereBranch ? `WHERE ${whereBranch} ` : '') + `ORDER BY ${entityConstructor.primaryKeyName})`;
 | 
			
		||||
 | 
			
		||||
    let contentToHash = await sql.getValue(query);
 | 
			
		||||
 | 
			
		||||
    if (!contentToHash) { // might be null in case of no rows
 | 
			
		||||
        contentToHash = "";
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user