From ed52919f9ebe7f2f91d3add6b0fa4d3f4d06b908 Mon Sep 17 00:00:00 2001 From: zadam Date: Mon, 27 Mar 2023 23:06:14 +0200 Subject: [PATCH 1/3] release 0.59.3 --- package.json | 2 +- src/services/build.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 5d7c9d49b..343cc0ad8 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "trilium", "productName": "Trilium Notes", "description": "Trilium Notes", - "version": "0.59.2", + "version": "0.59.3", "license": "AGPL-3.0-only", "main": "electron.js", "bin": { diff --git a/src/services/build.js b/src/services/build.js index 8b4a403e6..cea5cf6a6 100644 --- a/src/services/build.js +++ b/src/services/build.js @@ -1 +1 @@ -module.exports = { buildDate:"2023-03-14T21:15:08+01:00", buildRevision: "d8e9086bdeb721db795783b5d92395a9bd6882c9" }; +module.exports = { buildDate:"2023-03-27T23:06:14+02:00", buildRevision: "9881e6de3e4966af39ec6245562dca6ac7b25eaa" }; From e70cca4736cb127613218ca51574d7a7370a0583 Mon Sep 17 00:00:00 2001 From: zadam Date: Wed, 29 Mar 2023 23:07:47 +0200 Subject: [PATCH 2/3] fix trailing slash in shared note in IE, closes #3782 --- src/public/app/widgets/shared_info.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/public/app/widgets/shared_info.js b/src/public/app/widgets/shared_info.js index 8029ba24b..ebdfbb108 100644 --- a/src/public/app/widgets/shared_info.js +++ b/src/public/app/widgets/shared_info.js @@ -39,7 +39,14 @@ export default class SharedInfoWidget extends NoteContextAwareWidget { this.$sharedText.text("This note is shared publicly on"); } else { - link = `${location.protocol}//${location.host}${location.pathname}share/${shareId}`; + let host = location.host; + if (host.endsWith('/')) { + // seems like IE has trailing slash + // https://github.com/zadam/trilium/issues/3782 + host = host.substr(0, host.length - 1); + } + + link = `${location.protocol}//${host}${location.pathname}share/${shareId}`; this.$sharedText.text("This note is shared locally on"); } From 72b1cc4d8926c7f63f77344287cba0f3a3f9c055 Mon Sep 17 00:00:00 2001 From: zadam Date: Wed, 29 Mar 2023 23:16:45 +0200 Subject: [PATCH 3/3] fixed loading of parent to froca when e.g. sharing (cloning into not yet loaded _share parent) --- src/public/app/services/froca_updater.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/public/app/services/froca_updater.js b/src/public/app/services/froca_updater.js index 64eb653c0..070d6c2a2 100644 --- a/src/public/app/services/froca_updater.js +++ b/src/public/app/services/froca_updater.js @@ -14,7 +14,7 @@ async function processEntityChanges(entityChanges) { if (ec.entityName === 'notes') { processNoteChange(loadResults, ec); } else if (ec.entityName === 'branches') { - processBranchChange(loadResults, ec); + await processBranchChange(loadResults, ec); } else if (ec.entityName === 'attributes') { processAttributeChange(loadResults, ec); } else if (ec.entityName === 'note_reordering') { @@ -105,7 +105,7 @@ function processNoteChange(loadResults, ec) { } } -function processBranchChange(loadResults, ec) { +async function processBranchChange(loadResults, ec) { if (ec.isErased && ec.entityId in froca.branches) { utils.reloadFrontendApp(`${ec.entityName} ${ec.entityId} is erased, need to do complete reload.`); return; @@ -139,7 +139,15 @@ function processBranchChange(loadResults, ec) { loadResults.addBranch(ec.entityId, ec.componentId); const childNote = froca.notes[ec.entity.noteId]; - const parentNote = froca.notes[ec.entity.parentNoteId]; + let parentNote = froca.notes[ec.entity.parentNoteId]; + + if (childNote && !parentNote) { + // a branch cannot exist without the parent + // a note loaded into froca has to also contain all its ancestors + // this problem happened e.g. in sharing where _share was hidden and thus not loaded + // sharing meant cloning into _share, which crashed because _share was not loaded + parentNote = await froca.getNote(ec.entity.parentNoteId); + } if (branch) { branch.update(ec.entity);