mirror of
https://github.com/zadam/trilium.git
synced 2025-11-13 00:35:50 +01:00
fix deadlock after "cut to note", closes #1030
This commit is contained in:
@@ -229,7 +229,7 @@ subscribeToMessages(message => {
|
||||
async function processSyncRows(syncRows) {
|
||||
const missingNoteIds = [];
|
||||
|
||||
for (const {id, entityName, entity} of syncRows) {
|
||||
for (const {entityName, entity} of syncRows) {
|
||||
if (entityName === 'branches' && !(entity.parentNoteId in treeCache.notes)) {
|
||||
missingNoteIds.push(entity.parentNoteId);
|
||||
}
|
||||
|
||||
@@ -9,9 +9,11 @@ class ZoomService extends Component {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
options.initializedPromise.then(() => {
|
||||
this.setZoomFactor(options.getFloat('zoomFactor'));
|
||||
});
|
||||
if (utils.isElectron()) {
|
||||
options.initializedPromise.then(() => {
|
||||
this.setZoomFactor(options.getFloat('zoomFactor'));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
setZoomFactor(zoomFactor) {
|
||||
|
||||
@@ -82,6 +82,10 @@ export default class Component {
|
||||
let release;
|
||||
|
||||
try {
|
||||
if (this.mutex.isLocked()) {
|
||||
console.debug("Mutex locked for", this.constructor.name);
|
||||
}
|
||||
|
||||
release = await this.mutex.acquire();
|
||||
|
||||
await fun.call(this, data);
|
||||
@@ -93,4 +97,4 @@ export default class Component {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -308,9 +308,10 @@ export default class NoteDetailWidget extends TabAwareWidget {
|
||||
return;
|
||||
}
|
||||
|
||||
await noteCreateService.createNote(note.noteId, {
|
||||
// without await as this otherwise causes deadlock through component mutex
|
||||
noteCreateService.createNote(note.noteId, {
|
||||
isProtected: note.isProtected,
|
||||
saveSelection: true
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user