mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 11:39:01 +01:00 
			
		
		
		
	change the way frontend detects content change which works even if no new blob is created, fixes #4434
This commit is contained in:
		
							parent
							
								
									69ed3644f9
								
							
						
					
					
						commit
						cf068211ff
					
				
							
								
								
									
										116
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										116
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							| @ -15,7 +15,7 @@ | |||||||
|         "@excalidraw/excalidraw": "0.16.1", |         "@excalidraw/excalidraw": "0.16.1", | ||||||
|         "archiver": "6.0.1", |         "archiver": "6.0.1", | ||||||
|         "async-mutex": "0.4.0", |         "async-mutex": "0.4.0", | ||||||
|         "axios": "1.6.0", |         "axios": "1.6.1", | ||||||
|         "better-sqlite3": "8.4.0", |         "better-sqlite3": "8.4.0", | ||||||
|         "chokidar": "3.5.3", |         "chokidar": "3.5.3", | ||||||
|         "cls-hooked": "4.2.2", |         "cls-hooked": "4.2.2", | ||||||
| @ -35,7 +35,7 @@ | |||||||
|         "express-rate-limit": "7.1.4", |         "express-rate-limit": "7.1.4", | ||||||
|         "express-session": "1.17.3", |         "express-session": "1.17.3", | ||||||
|         "fs-extra": "11.1.1", |         "fs-extra": "11.1.1", | ||||||
|         "helmet": "7.0.0", |         "helmet": "7.1.0", | ||||||
|         "html": "1.0.0", |         "html": "1.0.0", | ||||||
|         "html2plaintext": "2.1.4", |         "html2plaintext": "2.1.4", | ||||||
|         "http-proxy-agent": "7.0.0", |         "http-proxy-agent": "7.0.0", | ||||||
| @ -47,8 +47,8 @@ | |||||||
|         "jimp": "0.22.10", |         "jimp": "0.22.10", | ||||||
|         "joplin-turndown-plugin-gfm": "1.0.12", |         "joplin-turndown-plugin-gfm": "1.0.12", | ||||||
|         "jsdom": "22.1.0", |         "jsdom": "22.1.0", | ||||||
|         "katex": "^0.16.9", |         "katex": "0.16.9", | ||||||
|         "marked": "9.1.5", |         "marked": "9.1.6", | ||||||
|         "mime-types": "2.1.35", |         "mime-types": "2.1.35", | ||||||
|         "multer": "1.4.5-lts.1", |         "multer": "1.4.5-lts.1", | ||||||
|         "node-abi": "3.51.0", |         "node-abi": "3.51.0", | ||||||
| @ -81,7 +81,7 @@ | |||||||
|       }, |       }, | ||||||
|       "devDependencies": { |       "devDependencies": { | ||||||
|         "cross-env": "7.0.3", |         "cross-env": "7.0.3", | ||||||
|         "electron": "25.9.3", |         "electron": "25.9.4", | ||||||
|         "electron-builder": "24.6.4", |         "electron-builder": "24.6.4", | ||||||
|         "electron-packager": "17.1.2", |         "electron-packager": "17.1.2", | ||||||
|         "electron-rebuild": "3.2.9", |         "electron-rebuild": "3.2.9", | ||||||
| @ -96,11 +96,11 @@ | |||||||
|         "jasmine": "5.1.0", |         "jasmine": "5.1.0", | ||||||
|         "jsdoc": "4.0.2", |         "jsdoc": "4.0.2", | ||||||
|         "jsonc-eslint-parser": "2.4.0", |         "jsonc-eslint-parser": "2.4.0", | ||||||
|         "lint-staged": "15.0.2", |         "lint-staged": "15.1.0", | ||||||
|         "lorem-ipsum": "2.0.8", |         "lorem-ipsum": "2.0.8", | ||||||
|         "nodemon": "3.0.1", |         "nodemon": "3.0.1", | ||||||
|         "prettier": "3.0.3", |         "prettier": "3.1.0", | ||||||
|         "rcedit": "4.0.0", |         "rcedit": "4.0.1", | ||||||
|         "webpack": "5.89.0", |         "webpack": "5.89.0", | ||||||
|         "webpack-cli": "5.1.4" |         "webpack-cli": "5.1.4" | ||||||
|       }, |       }, | ||||||
| @ -2475,9 +2475,9 @@ | |||||||
|       "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" |       "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" | ||||||
|     }, |     }, | ||||||
|     "node_modules/axios": { |     "node_modules/axios": { | ||||||
|       "version": "1.6.0", |       "version": "1.6.1", | ||||||
|       "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.0.tgz", |       "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.1.tgz", | ||||||
|       "integrity": "sha512-EZ1DYihju9pwVB+jg67ogm+Tmqc6JmhamRN6I4Zt8DfZu5lbcQGw3ozH9lFejSJgs/ibaef3A9PMXPLeefFGJg==", |       "integrity": "sha512-vfBmhDpKafglh0EldBEbVuoe7DyAavGSLWhuSm5ZSEKQnHhBf0xAAwybbNH1IkrJNGnS/VG4I5yxig1pCEXE4g==", | ||||||
|       "dependencies": { |       "dependencies": { | ||||||
|         "follow-redirects": "^1.15.0", |         "follow-redirects": "^1.15.0", | ||||||
|         "form-data": "^4.0.0", |         "form-data": "^4.0.0", | ||||||
| @ -4366,9 +4366,9 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "node_modules/electron": { |     "node_modules/electron": { | ||||||
|       "version": "25.9.3", |       "version": "25.9.4", | ||||||
|       "resolved": "https://registry.npmjs.org/electron/-/electron-25.9.3.tgz", |       "resolved": "https://registry.npmjs.org/electron/-/electron-25.9.4.tgz", | ||||||
|       "integrity": "sha512-dacaHg/PuwVcFRgPDCM5j7UDzqGJWOsbBRdS5wPKLNS/ejPeccIjuNUT1cqcrpvCJKAFW8swHWg9kdizNSEDHQ==", |       "integrity": "sha512-5pDU8a7o7ZIPTZHAqjflGMq764Favdsc271KXrAT3oWvFTHs5Ve9+IOt5EUVPrwvC2qRWKpCIEM47WzwkTlENQ==", | ||||||
|       "hasInstallScript": true, |       "hasInstallScript": true, | ||||||
|       "dependencies": { |       "dependencies": { | ||||||
|         "@electron/get": "^2.0.0", |         "@electron/get": "^2.0.0", | ||||||
| @ -6926,9 +6926,9 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "node_modules/helmet": { |     "node_modules/helmet": { | ||||||
|       "version": "7.0.0", |       "version": "7.1.0", | ||||||
|       "resolved": "https://registry.npmjs.org/helmet/-/helmet-7.0.0.tgz", |       "resolved": "https://registry.npmjs.org/helmet/-/helmet-7.1.0.tgz", | ||||||
|       "integrity": "sha512-MsIgYmdBh460ZZ8cJC81q4XJknjG567wzEmv46WOBblDb6TUd3z8/GhgmsM9pn8g2B80tAJ4m5/d3Bi1KrSUBQ==", |       "integrity": "sha512-g+HZqgfbpXdCkme/Cd/mZkV0aV3BZZZSugecH03kl38m/Kmdx8jKjBikpDj2cr+Iynv4KpYEviojNdTJActJAg==", | ||||||
|       "engines": { |       "engines": { | ||||||
|         "node": ">=16.0.0" |         "node": ">=16.0.0" | ||||||
|       } |       } | ||||||
| @ -8413,9 +8413,9 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "node_modules/lint-staged": { |     "node_modules/lint-staged": { | ||||||
|       "version": "15.0.2", |       "version": "15.1.0", | ||||||
|       "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.0.2.tgz", |       "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.1.0.tgz", | ||||||
|       "integrity": "sha512-vnEy7pFTHyVuDmCAIFKR5QDO8XLVlPFQQyujQ/STOxe40ICWqJ6knS2wSJ/ffX/Lw0rz83luRDh+ET7toN+rOw==", |       "integrity": "sha512-ZPKXWHVlL7uwVpy8OZ7YQjYDAuO5X4kMh0XgZvPNxLcCCngd0PO5jKQyy3+s4TL2EnHoIXIzP1422f/l3nZKMw==", | ||||||
|       "dev": true, |       "dev": true, | ||||||
|       "dependencies": { |       "dependencies": { | ||||||
|         "chalk": "5.3.0", |         "chalk": "5.3.0", | ||||||
| @ -8427,7 +8427,7 @@ | |||||||
|         "micromatch": "4.0.5", |         "micromatch": "4.0.5", | ||||||
|         "pidtree": "0.6.0", |         "pidtree": "0.6.0", | ||||||
|         "string-argv": "0.3.2", |         "string-argv": "0.3.2", | ||||||
|         "yaml": "2.3.3" |         "yaml": "2.3.4" | ||||||
|       }, |       }, | ||||||
|       "bin": { |       "bin": { | ||||||
|         "lint-staged": "bin/lint-staged.js" |         "lint-staged": "bin/lint-staged.js" | ||||||
| @ -9086,9 +9086,9 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "node_modules/marked": { |     "node_modules/marked": { | ||||||
|       "version": "9.1.5", |       "version": "9.1.6", | ||||||
|       "resolved": "https://registry.npmjs.org/marked/-/marked-9.1.5.tgz", |       "resolved": "https://registry.npmjs.org/marked/-/marked-9.1.6.tgz", | ||||||
|       "integrity": "sha512-14QG3shv8Kg/xc0Yh6TNkMj90wXH9mmldi5941I2OevfJ/FQAFLEwtwU2/FfgSAOMlWHrEukWSGQf8MiVYNG2A==", |       "integrity": "sha512-jcByLnIFkd5gSXZmjNvS1TlmRhCXZjIzHYlaGkPlLIekG55JDR2Z4va9tZwCiP+/RDERiNhMOFu01xd6O5ct1Q==", | ||||||
|       "bin": { |       "bin": { | ||||||
|         "marked": "bin/marked.js" |         "marked": "bin/marked.js" | ||||||
|       }, |       }, | ||||||
| @ -10475,9 +10475,9 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "node_modules/prettier": { |     "node_modules/prettier": { | ||||||
|       "version": "3.0.3", |       "version": "3.1.0", | ||||||
|       "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", |       "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.1.0.tgz", | ||||||
|       "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", |       "integrity": "sha512-TQLvXjq5IAibjh8EpBIkNKxO749UEWABoiIZehEPiY4GNpVdhaFKqSTu+QrlU6D2dPAfubRmtJTi4K4YkQ5eXw==", | ||||||
|       "dev": true, |       "dev": true, | ||||||
|       "bin": { |       "bin": { | ||||||
|         "prettier": "bin/prettier.cjs" |         "prettier": "bin/prettier.cjs" | ||||||
| @ -10730,9 +10730,9 @@ | |||||||
|       "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" |       "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" | ||||||
|     }, |     }, | ||||||
|     "node_modules/rcedit": { |     "node_modules/rcedit": { | ||||||
|       "version": "4.0.0", |       "version": "4.0.1", | ||||||
|       "resolved": "https://registry.npmjs.org/rcedit/-/rcedit-4.0.0.tgz", |       "resolved": "https://registry.npmjs.org/rcedit/-/rcedit-4.0.1.tgz", | ||||||
|       "integrity": "sha512-OIPwu2e0b2WF4urFMcdiYUZGjmwh5pa52Mt847MK7ovxHkjpiPaI4Ov2atjeKTNFo4Tas0G31Qm7K21t87hp+g==", |       "integrity": "sha512-bZdaQi34krFWhrDn+O53ccBDw0MkAT2Vhu75SqhtvhQu4OPyFM4RoVheyYiVQYdjhUi6EJMVWQ0tR6bCIYVkUg==", | ||||||
|       "dev": true, |       "dev": true, | ||||||
|       "dependencies": { |       "dependencies": { | ||||||
|         "cross-spawn-windows-exe": "^1.1.0" |         "cross-spawn-windows-exe": "^1.1.0" | ||||||
| @ -13549,9 +13549,9 @@ | |||||||
|       "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" |       "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" | ||||||
|     }, |     }, | ||||||
|     "node_modules/yaml": { |     "node_modules/yaml": { | ||||||
|       "version": "2.3.3", |       "version": "2.3.4", | ||||||
|       "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.3.tgz", |       "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz", | ||||||
|       "integrity": "sha512-zw0VAJxgeZ6+++/su5AFoqBbZbrEakwu+X0M5HmcwUiBL7AzcuPKjj5we4xfQLp78LkEMpD0cOnUhmgOVy3KdQ==", |       "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", | ||||||
|       "dev": true, |       "dev": true, | ||||||
|       "engines": { |       "engines": { | ||||||
|         "node": ">= 14" |         "node": ">= 14" | ||||||
| @ -15522,9 +15522,9 @@ | |||||||
|       "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" |       "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" | ||||||
|     }, |     }, | ||||||
|     "axios": { |     "axios": { | ||||||
|       "version": "1.6.0", |       "version": "1.6.1", | ||||||
|       "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.0.tgz", |       "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.1.tgz", | ||||||
|       "integrity": "sha512-EZ1DYihju9pwVB+jg67ogm+Tmqc6JmhamRN6I4Zt8DfZu5lbcQGw3ozH9lFejSJgs/ibaef3A9PMXPLeefFGJg==", |       "integrity": "sha512-vfBmhDpKafglh0EldBEbVuoe7DyAavGSLWhuSm5ZSEKQnHhBf0xAAwybbNH1IkrJNGnS/VG4I5yxig1pCEXE4g==", | ||||||
|       "requires": { |       "requires": { | ||||||
|         "follow-redirects": "^1.15.0", |         "follow-redirects": "^1.15.0", | ||||||
|         "form-data": "^4.0.0", |         "form-data": "^4.0.0", | ||||||
| @ -16964,9 +16964,9 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "electron": { |     "electron": { | ||||||
|       "version": "25.9.3", |       "version": "25.9.4", | ||||||
|       "resolved": "https://registry.npmjs.org/electron/-/electron-25.9.3.tgz", |       "resolved": "https://registry.npmjs.org/electron/-/electron-25.9.4.tgz", | ||||||
|       "integrity": "sha512-dacaHg/PuwVcFRgPDCM5j7UDzqGJWOsbBRdS5wPKLNS/ejPeccIjuNUT1cqcrpvCJKAFW8swHWg9kdizNSEDHQ==", |       "integrity": "sha512-5pDU8a7o7ZIPTZHAqjflGMq764Favdsc271KXrAT3oWvFTHs5Ve9+IOt5EUVPrwvC2qRWKpCIEM47WzwkTlENQ==", | ||||||
|       "requires": { |       "requires": { | ||||||
|         "@electron/get": "^2.0.0", |         "@electron/get": "^2.0.0", | ||||||
|         "@types/node": "^18.11.18", |         "@types/node": "^18.11.18", | ||||||
| @ -18878,9 +18878,9 @@ | |||||||
|       "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==" |       "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==" | ||||||
|     }, |     }, | ||||||
|     "helmet": { |     "helmet": { | ||||||
|       "version": "7.0.0", |       "version": "7.1.0", | ||||||
|       "resolved": "https://registry.npmjs.org/helmet/-/helmet-7.0.0.tgz", |       "resolved": "https://registry.npmjs.org/helmet/-/helmet-7.1.0.tgz", | ||||||
|       "integrity": "sha512-MsIgYmdBh460ZZ8cJC81q4XJknjG567wzEmv46WOBblDb6TUd3z8/GhgmsM9pn8g2B80tAJ4m5/d3Bi1KrSUBQ==" |       "integrity": "sha512-g+HZqgfbpXdCkme/Cd/mZkV0aV3BZZZSugecH03kl38m/Kmdx8jKjBikpDj2cr+Iynv4KpYEviojNdTJActJAg==" | ||||||
|     }, |     }, | ||||||
|     "hosted-git-info": { |     "hosted-git-info": { | ||||||
|       "version": "2.8.9", |       "version": "2.8.9", | ||||||
| @ -19960,9 +19960,9 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "lint-staged": { |     "lint-staged": { | ||||||
|       "version": "15.0.2", |       "version": "15.1.0", | ||||||
|       "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.0.2.tgz", |       "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.1.0.tgz", | ||||||
|       "integrity": "sha512-vnEy7pFTHyVuDmCAIFKR5QDO8XLVlPFQQyujQ/STOxe40ICWqJ6knS2wSJ/ffX/Lw0rz83luRDh+ET7toN+rOw==", |       "integrity": "sha512-ZPKXWHVlL7uwVpy8OZ7YQjYDAuO5X4kMh0XgZvPNxLcCCngd0PO5jKQyy3+s4TL2EnHoIXIzP1422f/l3nZKMw==", | ||||||
|       "dev": true, |       "dev": true, | ||||||
|       "requires": { |       "requires": { | ||||||
|         "chalk": "5.3.0", |         "chalk": "5.3.0", | ||||||
| @ -19974,7 +19974,7 @@ | |||||||
|         "micromatch": "4.0.5", |         "micromatch": "4.0.5", | ||||||
|         "pidtree": "0.6.0", |         "pidtree": "0.6.0", | ||||||
|         "string-argv": "0.3.2", |         "string-argv": "0.3.2", | ||||||
|         "yaml": "2.3.3" |         "yaml": "2.3.4" | ||||||
|       }, |       }, | ||||||
|       "dependencies": { |       "dependencies": { | ||||||
|         "chalk": { |         "chalk": { | ||||||
| @ -20431,9 +20431,9 @@ | |||||||
|       "requires": {} |       "requires": {} | ||||||
|     }, |     }, | ||||||
|     "marked": { |     "marked": { | ||||||
|       "version": "9.1.5", |       "version": "9.1.6", | ||||||
|       "resolved": "https://registry.npmjs.org/marked/-/marked-9.1.5.tgz", |       "resolved": "https://registry.npmjs.org/marked/-/marked-9.1.6.tgz", | ||||||
|       "integrity": "sha512-14QG3shv8Kg/xc0Yh6TNkMj90wXH9mmldi5941I2OevfJ/FQAFLEwtwU2/FfgSAOMlWHrEukWSGQf8MiVYNG2A==" |       "integrity": "sha512-jcByLnIFkd5gSXZmjNvS1TlmRhCXZjIzHYlaGkPlLIekG55JDR2Z4va9tZwCiP+/RDERiNhMOFu01xd6O5ct1Q==" | ||||||
|     }, |     }, | ||||||
|     "matcher": { |     "matcher": { | ||||||
|       "version": "3.0.0", |       "version": "3.0.0", | ||||||
| @ -21478,9 +21478,9 @@ | |||||||
|       "dev": true |       "dev": true | ||||||
|     }, |     }, | ||||||
|     "prettier": { |     "prettier": { | ||||||
|       "version": "3.0.3", |       "version": "3.1.0", | ||||||
|       "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", |       "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.1.0.tgz", | ||||||
|       "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", |       "integrity": "sha512-TQLvXjq5IAibjh8EpBIkNKxO749UEWABoiIZehEPiY4GNpVdhaFKqSTu+QrlU6D2dPAfubRmtJTi4K4YkQ5eXw==", | ||||||
|       "dev": true |       "dev": true | ||||||
|     }, |     }, | ||||||
|     "prettier-linter-helpers": { |     "prettier-linter-helpers": { | ||||||
| @ -21663,9 +21663,9 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "rcedit": { |     "rcedit": { | ||||||
|       "version": "4.0.0", |       "version": "4.0.1", | ||||||
|       "resolved": "https://registry.npmjs.org/rcedit/-/rcedit-4.0.0.tgz", |       "resolved": "https://registry.npmjs.org/rcedit/-/rcedit-4.0.1.tgz", | ||||||
|       "integrity": "sha512-OIPwu2e0b2WF4urFMcdiYUZGjmwh5pa52Mt847MK7ovxHkjpiPaI4Ov2atjeKTNFo4Tas0G31Qm7K21t87hp+g==", |       "integrity": "sha512-bZdaQi34krFWhrDn+O53ccBDw0MkAT2Vhu75SqhtvhQu4OPyFM4RoVheyYiVQYdjhUi6EJMVWQ0tR6bCIYVkUg==", | ||||||
|       "dev": true, |       "dev": true, | ||||||
|       "requires": { |       "requires": { | ||||||
|         "cross-spawn-windows-exe": "^1.1.0" |         "cross-spawn-windows-exe": "^1.1.0" | ||||||
| @ -23772,9 +23772,9 @@ | |||||||
|       "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" |       "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" | ||||||
|     }, |     }, | ||||||
|     "yaml": { |     "yaml": { | ||||||
|       "version": "2.3.3", |       "version": "2.3.4", | ||||||
|       "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.3.tgz", |       "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz", | ||||||
|       "integrity": "sha512-zw0VAJxgeZ6+++/su5AFoqBbZbrEakwu+X0M5HmcwUiBL7AzcuPKjj5we4xfQLp78LkEMpD0cOnUhmgOVy3KdQ==", |       "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", | ||||||
|       "dev": true |       "dev": true | ||||||
|     }, |     }, | ||||||
|     "yargs": { |     "yargs": { | ||||||
|  | |||||||
							
								
								
									
										16
									
								
								package.json
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								package.json
									
									
									
									
									
								
							| @ -41,7 +41,7 @@ | |||||||
|     "@excalidraw/excalidraw": "0.16.1", |     "@excalidraw/excalidraw": "0.16.1", | ||||||
|     "archiver": "6.0.1", |     "archiver": "6.0.1", | ||||||
|     "async-mutex": "0.4.0", |     "async-mutex": "0.4.0", | ||||||
|     "axios": "1.6.0", |     "axios": "1.6.1", | ||||||
|     "better-sqlite3": "8.4.0", |     "better-sqlite3": "8.4.0", | ||||||
|     "chokidar": "3.5.3", |     "chokidar": "3.5.3", | ||||||
|     "cls-hooked": "4.2.2", |     "cls-hooked": "4.2.2", | ||||||
| @ -61,7 +61,7 @@ | |||||||
|     "express-rate-limit": "7.1.4", |     "express-rate-limit": "7.1.4", | ||||||
|     "express-session": "1.17.3", |     "express-session": "1.17.3", | ||||||
|     "fs-extra": "11.1.1", |     "fs-extra": "11.1.1", | ||||||
|     "helmet": "7.0.0", |     "helmet": "7.1.0", | ||||||
|     "html": "1.0.0", |     "html": "1.0.0", | ||||||
|     "html2plaintext": "2.1.4", |     "html2plaintext": "2.1.4", | ||||||
|     "http-proxy-agent": "7.0.0", |     "http-proxy-agent": "7.0.0", | ||||||
| @ -73,8 +73,8 @@ | |||||||
|     "jimp": "0.22.10", |     "jimp": "0.22.10", | ||||||
|     "joplin-turndown-plugin-gfm": "1.0.12", |     "joplin-turndown-plugin-gfm": "1.0.12", | ||||||
|     "jsdom": "22.1.0", |     "jsdom": "22.1.0", | ||||||
|     "katex": "^0.16.9", |     "katex": "0.16.9", | ||||||
|     "marked": "9.1.5", |     "marked": "9.1.6", | ||||||
|     "mime-types": "2.1.35", |     "mime-types": "2.1.35", | ||||||
|     "multer": "1.4.5-lts.1", |     "multer": "1.4.5-lts.1", | ||||||
|     "node-abi": "3.51.0", |     "node-abi": "3.51.0", | ||||||
| @ -104,7 +104,7 @@ | |||||||
|   }, |   }, | ||||||
|   "devDependencies": { |   "devDependencies": { | ||||||
|     "cross-env": "7.0.3", |     "cross-env": "7.0.3", | ||||||
|     "electron": "25.9.3", |     "electron": "25.9.4", | ||||||
|     "electron-builder": "24.6.4", |     "electron-builder": "24.6.4", | ||||||
|     "electron-packager": "17.1.2", |     "electron-packager": "17.1.2", | ||||||
|     "electron-rebuild": "3.2.9", |     "electron-rebuild": "3.2.9", | ||||||
| @ -119,11 +119,11 @@ | |||||||
|     "jasmine": "5.1.0", |     "jasmine": "5.1.0", | ||||||
|     "jsdoc": "4.0.2", |     "jsdoc": "4.0.2", | ||||||
|     "jsonc-eslint-parser": "2.4.0", |     "jsonc-eslint-parser": "2.4.0", | ||||||
|     "lint-staged": "15.0.2", |     "lint-staged": "15.1.0", | ||||||
|     "lorem-ipsum": "2.0.8", |     "lorem-ipsum": "2.0.8", | ||||||
|     "nodemon": "3.0.1", |     "nodemon": "3.0.1", | ||||||
|     "prettier": "3.0.3", |     "prettier": "3.1.0", | ||||||
|     "rcedit": "4.0.0", |     "rcedit": "4.0.1", | ||||||
|     "webpack": "5.89.0", |     "webpack": "5.89.0", | ||||||
|     "webpack-cli": "5.1.4" |     "webpack-cli": "5.1.4" | ||||||
|   }, |   }, | ||||||
|  | |||||||
| @ -180,7 +180,7 @@ class AbstractBeccaEntity { | |||||||
| 
 | 
 | ||||||
|         sql.execute("DELETE FROM blobs WHERE blobId = ?", [oldBlobId]); |         sql.execute("DELETE FROM blobs WHERE blobId = ?", [oldBlobId]); | ||||||
|         // blobs are not marked as erased in entity_changes, they are just purged completely
 |         // blobs are not marked as erased in entity_changes, they are just purged completely
 | ||||||
|         // this is because technically every keystroke can create a new blob and there would be just too many
 |         // this is because technically every keystroke can create a new blob, and there would be just too many
 | ||||||
|         sql.execute("DELETE FROM entity_changes WHERE entityName = 'blobs' AND entityId = ?", [oldBlobId]); |         sql.execute("DELETE FROM entity_changes WHERE entityName = 'blobs' AND entityId = ?", [oldBlobId]); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| @ -230,7 +230,7 @@ class AbstractBeccaEntity { | |||||||
|             isErased: false, |             isErased: false, | ||||||
|             utcDateChanged: pojo.utcDateModified, |             utcDateChanged: pojo.utcDateModified, | ||||||
|             isSynced: true, |             isSynced: true, | ||||||
|             // overriding componentId will cause frontend to think the change is coming from a different component
 |             // overriding componentId will cause the frontend to think the change is coming from a different component
 | ||||||
|             // and thus reload
 |             // and thus reload
 | ||||||
|             componentId: opts.forceFrontendReload ? utils.randomString(10) : null |             componentId: opts.forceFrontendReload ? utils.randomString(10) : null | ||||||
|         }); |         }); | ||||||
|  | |||||||
| @ -93,6 +93,9 @@ class FNote { | |||||||
|          * @type {string} |          * @type {string} | ||||||
|          */ |          */ | ||||||
|         this.mime = row.mime; |         this.mime = row.mime; | ||||||
|  | 
 | ||||||
|  |         // the main use case to keep this is to detect content change which should trigger refresh
 | ||||||
|  |         this.blobId = row.blobId; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     addParent(parentNoteId, branchId, sort = true) { |     addParent(parentNoteId, branchId, sort = true) { | ||||||
|  | |||||||
| @ -369,12 +369,15 @@ class Froca { | |||||||
| 
 | 
 | ||||||
|     /** @returns {Promise<FBlob>} */ |     /** @returns {Promise<FBlob>} */ | ||||||
|     async getBlob(entityType, entityId) { |     async getBlob(entityType, entityId) { | ||||||
|  |         // I'm not sure why we're not using blobIds directly, it would save us this composite key ...
 | ||||||
|  |         // perhaps one benefit is that we're always requesting the latest blob, not relying on perhaps faulty/slow
 | ||||||
|  |         // websocket update?
 | ||||||
|         const key = `${entityType}-${entityId}`; |         const key = `${entityType}-${entityId}`; | ||||||
| 
 | 
 | ||||||
|         if (!this.blobPromises[key]) { |         if (!this.blobPromises[key]) { | ||||||
|             this.blobPromises[key] = server.get(`${entityType}/${entityId}/blob`) |             this.blobPromises[key] = server.get(`${entityType}/${entityId}/blob`) | ||||||
|                 .then(row => new FBlob(row)) |                 .then(row => new FBlob(row)) | ||||||
|                 .catch(e => console.error(`Cannot get blob for ${entityType} '${entityId}'`)); |                 .catch(e => console.error(`Cannot get blob for ${entityType} '${entityId}'`, e)); | ||||||
| 
 | 
 | ||||||
|             // we don't want to keep large payloads forever in memory, so we clean that up quite quickly
 |             // we don't want to keep large payloads forever in memory, so we clean that up quite quickly
 | ||||||
|             // this cache is more meant to share the data between different components within one business transaction (e.g. loading of the note into the tab context and all the components)
 |             // this cache is more meant to share the data between different components within one business transaction (e.g. loading of the note into the tab context and all the components)
 | ||||||
|  | |||||||
| @ -20,18 +20,6 @@ async function processEntityChanges(entityChanges) { | |||||||
|                 processAttributeChange(loadResults, ec); |                 processAttributeChange(loadResults, ec); | ||||||
|             } else if (ec.entityName === 'note_reordering') { |             } else if (ec.entityName === 'note_reordering') { | ||||||
|                 processNoteReordering(loadResults, ec); |                 processNoteReordering(loadResults, ec); | ||||||
|             } else if (ec.entityName === 'blobs') { |  | ||||||
|                 if (!ec.isErased) { |  | ||||||
|                     for (const affectedNoteId of ec.noteIds) { |  | ||||||
|                         for (const key of Object.keys(froca.blobPromises)) { |  | ||||||
|                             if (key.includes(affectedNoteId)) { |  | ||||||
|                                 delete froca.blobPromises[key]; |  | ||||||
|                             } |  | ||||||
|                         } |  | ||||||
|                     } |  | ||||||
| 
 |  | ||||||
|                     loadResults.addNoteContent(ec.noteIds, ec.componentId); |  | ||||||
|                 } |  | ||||||
|             } else if (ec.entityName === 'revisions') { |             } else if (ec.entityName === 'revisions') { | ||||||
|                 loadResults.addRevision(ec.entityId, ec.noteId, ec.componentId); |                 loadResults.addRevision(ec.entityId, ec.noteId, ec.componentId); | ||||||
|             } else if (ec.entityName === 'options') { |             } else if (ec.entityName === 'options') { | ||||||
| @ -44,7 +32,7 @@ async function processEntityChanges(entityChanges) { | |||||||
|                 loadResults.addOption(ec.entity.name); |                 loadResults.addOption(ec.entity.name); | ||||||
|             } else if (ec.entityName === 'attachments') { |             } else if (ec.entityName === 'attachments') { | ||||||
|                 processAttachment(loadResults, ec); |                 processAttachment(loadResults, ec); | ||||||
|             } else if (ec.entityName === 'etapi_tokens') { |             } else if (ec.entityName === 'blobs' || ec.entityName === 'etapi_tokens') { | ||||||
|                 // NOOP
 |                 // NOOP
 | ||||||
|             } |             } | ||||||
|             else { |             else { | ||||||
| @ -114,6 +102,16 @@ function processNoteChange(loadResults, ec) { | |||||||
|         delete froca.notes[ec.entityId]; |         delete froca.notes[ec.entityId]; | ||||||
|     } |     } | ||||||
|     else { |     else { | ||||||
|  |         if (note.blobId !== ec.entity.blobId) { | ||||||
|  |             for (const key of Object.keys(froca.blobPromises)) { | ||||||
|  |                 if (key.includes(note.noteId)) { | ||||||
|  |                     delete froca.blobPromises[key]; | ||||||
|  |                 } | ||||||
|  |             } | ||||||
|  | 
 | ||||||
|  |             loadResults.addNoteContent(note.noteId, ec.componentId); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|         note.update(ec.entity); |         note.update(ec.entity); | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  | |||||||
| @ -95,10 +95,8 @@ export default class LoadResults { | |||||||
|         return componentIds && componentIds.find(sId => sId !== componentId) !== undefined; |         return componentIds && componentIds.find(sId => sId !== componentId) !== undefined; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     addNoteContent(noteIds, componentId) { |     addNoteContent(noteId, componentId) { | ||||||
|         for (const noteId of noteIds || []) { |         this.contentNoteIdToComponentId.push({noteId, componentId}); | ||||||
|             this.contentNoteIdToComponentId.push({noteId, componentId}); |  | ||||||
|         } |  | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     isNoteContentReloaded(noteId, componentId) { |     isNoteContentReloaded(noteId, componentId) { | ||||||
|  | |||||||
| @ -58,7 +58,8 @@ function getNotesAndBranchesAndAttributes(noteIds) { | |||||||
|             title: note.getTitleOrProtected(), |             title: note.getTitleOrProtected(), | ||||||
|             isProtected: note.isProtected, |             isProtected: note.isProtected, | ||||||
|             type: note.type, |             type: note.type, | ||||||
|             mime: note.mime |             mime: note.mime, | ||||||
|  |             blobId: note.blobId | ||||||
|         }); |         }); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -147,8 +147,6 @@ function fillInAdditionalProperties(entityChange) { | |||||||
|         if (!entityChange.entity) { |         if (!entityChange.entity) { | ||||||
|             entityChange.entity = sql.getRow(`SELECT * FROM options WHERE name = ?`, [entityChange.entityId]); |             entityChange.entity = sql.getRow(`SELECT * FROM options WHERE name = ?`, [entityChange.entityId]); | ||||||
|         } |         } | ||||||
|     } else if (entityChange.entityName === 'blobs') { |  | ||||||
|         entityChange.noteIds = sql.getColumn("SELECT noteId FROM notes WHERE blobId = ? AND isDeleted = 0", [entityChange.entityId]); |  | ||||||
|     } else if (entityChange.entityName === 'attachments') { |     } else if (entityChange.entityName === 'attachments') { | ||||||
|         entityChange.entity = sql.getRow(`SELECT attachments.*, LENGTH(blobs.content) AS contentLength
 |         entityChange.entity = sql.getRow(`SELECT attachments.*, LENGTH(blobs.content) AS contentLength
 | ||||||
|                                                 FROM attachments |                                                 FROM attachments | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 zadam
						zadam