Compare commits

..

4 Commits

Author SHA1 Message Date
zadam
ddc79b2517 release 0.29.1 2019-02-12 20:30:07 +01:00
zadam
8b250ed523 fix upload of the same file in succession, #388 2019-02-03 17:44:06 +01:00
zadam
d8b78d8025 check reference issues only for non deleted entities 2019-02-03 16:27:26 +01:00
zadam
42112b8053 fix consistency check 2019-02-03 16:22:45 +01:00
6 changed files with 19 additions and 10 deletions

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{ {
"name": "trilium", "name": "trilium",
"version": "0.28.3", "version": "0.29.0-beta",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@@ -2,7 +2,7 @@
"name": "trilium", "name": "trilium",
"productName": "Trilium Notes", "productName": "Trilium Notes",
"description": "Trilium Notes", "description": "Trilium Notes",
"version": "0.29.0-beta", "version": "0.29.1",
"license": "AGPL-3.0-only", "license": "AGPL-3.0-only",
"main": "electron.js", "main": "electron.js",
"bin": { "bin": {

View File

@@ -23,6 +23,10 @@ $("#import-upload").change(async function() {
const formData = new FormData(); const formData = new FormData();
formData.append('upload', this.files[0]); formData.append('upload', this.files[0]);
// this is done to reset the field otherwise triggering import same file again would not work
// https://github.com/zadam/trilium/issues/388
$("#import-upload").val('');
await $.ajax({ await $.ajax({
url: baseApiUrl + 'notes/' + importNoteId + '/import', url: baseApiUrl + 'notes/' + importNoteId + '/import',
headers: server.getHeaders(), headers: server.getHeaders(),

View File

@@ -10,6 +10,10 @@ $("#file-upload").change(async function() {
const formData = new FormData(); const formData = new FormData();
formData.append('upload', this.files[0]); formData.append('upload', this.files[0]);
// this is done to reset the field otherwise triggering import same file again would not work
// https://github.com/zadam/trilium/issues/388
$("#file-upload").val('');
const resp = await $.ajax({ const resp = await $.ajax({
url: baseApiUrl + 'notes/' + noteDetailService.getCurrentNoteId() + '/upload', url: baseApiUrl + 'notes/' + noteDetailService.getCurrentNoteId() + '/upload',
headers: server.getHeaders(), headers: server.getHeaders(),

View File

@@ -1 +1 @@
module.exports = { buildDate:"2019-02-03T15:44:19+01:00", buildRevision: "afd5f4823f1f605300f906a61e8822e857b9ee5f" }; module.exports = { buildDate:"2019-02-12T20:30:07+01:00", buildRevision: "8b250ed523f851afc0923342827679e805329838" };

View File

@@ -92,38 +92,39 @@ async function findBrokenReferenceIssues() {
await findIssues(` await findIssues(`
SELECT branchId, branches.noteId SELECT branchId, branches.noteId
FROM branches LEFT JOIN notes USING(noteId) FROM branches LEFT JOIN notes USING(noteId)
WHERE notes.noteId IS NULL`, WHERE branches.isDeleted = 0 AND notes.noteId IS NULL`,
({branchId, noteId}) => `Branch ${branchId} references missing note ${noteId}`); ({branchId, noteId}) => `Branch ${branchId} references missing note ${noteId}`);
await findIssues(` await findIssues(`
SELECT branchId, branches.noteId AS parentNoteId SELECT branchId, branches.noteId AS parentNoteId
FROM branches LEFT JOIN notes ON notes.noteId = branches.parentNoteId FROM branches LEFT JOIN notes ON notes.noteId = branches.parentNoteId
WHERE branches.branchId != 'root' AND notes.noteId IS NULL`, WHERE branches.isDeleted = 0 AND branches.branchId != 'root' AND notes.noteId IS NULL`,
({branchId, noteId}) => `Branch ${branchId} references missing parent note ${noteId}`); ({branchId, noteId}) => `Branch ${branchId} references missing parent note ${noteId}`);
await findIssues(` await findIssues(`
SELECT attributeId, attributes.noteId SELECT attributeId, attributes.noteId
FROM attributes LEFT JOIN notes USING(noteId) FROM attributes LEFT JOIN notes USING(noteId)
WHERE notes.noteId IS NULL`, WHERE attributes.isDeleted = 0 AND notes.noteId IS NULL`,
({attributeId, noteId}) => `Attribute ${attributeId} references missing source note ${noteId}`); ({attributeId, noteId}) => `Attribute ${attributeId} references missing source note ${noteId}`);
// empty targetNoteId for relations is a special fixable case so not covered here // empty targetNoteId for relations is a special fixable case so not covered here
await findIssues(` await findIssues(`
SELECT attributeId, attributes.noteId SELECT attributeId, attributes.value AS noteId
FROM attributes LEFT JOIN notes ON notes.noteId = attributes.value FROM attributes LEFT JOIN notes ON notes.noteId = attributes.value
WHERE attributes.type = 'relation' AND attributes.value != '' AND notes.noteId IS NULL`, WHERE attributes.isDeleted = 0 AND attributes.type = 'relation'
AND attributes.value != '' AND notes.noteId IS NULL`,
({attributeId, noteId}) => `Relation ${attributeId} references missing note ${noteId}`); ({attributeId, noteId}) => `Relation ${attributeId} references missing note ${noteId}`);
await findIssues(` await findIssues(`
SELECT linkId, links.noteId SELECT linkId, links.noteId
FROM links LEFT JOIN notes USING(noteId) FROM links LEFT JOIN notes USING(noteId)
WHERE notes.noteId IS NULL`, WHERE links.isDeleted = 0 AND notes.noteId IS NULL`,
({linkId, noteId}) => `Link ${linkId} references missing source note ${noteId}`); ({linkId, noteId}) => `Link ${linkId} references missing source note ${noteId}`);
await findIssues(` await findIssues(`
SELECT linkId, links.noteId SELECT linkId, links.noteId
FROM links LEFT JOIN notes ON notes.noteId = links.targetNoteId FROM links LEFT JOIN notes ON notes.noteId = links.targetNoteId
WHERE notes.noteId IS NULL`, WHERE links.isDeleted = 0 AND notes.noteId IS NULL`,
({linkId, noteId}) => `Link ${linkId} references missing target note ${noteId}`); ({linkId, noteId}) => `Link ${linkId} references missing target note ${noteId}`);
await findIssues(` await findIssues(`