mirror of
https://github.com/zadam/trilium.git
synced 2025-01-15 19:51:57 +08:00
extra check that hidden tree is not created until migration is completed
This commit is contained in:
parent
4ba72bc8d3
commit
9eff08144c
2 changed files with 10 additions and 1 deletions
|
@ -1,6 +1,8 @@
|
|||
const becca = require("../becca/becca");
|
||||
const noteService = require("./notes");
|
||||
const Attribute = require("../becca/entities/attribute.js");
|
||||
const log = require("./log");
|
||||
const migrationService = require("./migration");
|
||||
|
||||
const LBTPL_ROOT = "_lbTplRoot";
|
||||
const LBTPL_BASE = "_lbTplBase";
|
||||
|
@ -231,6 +233,12 @@ const HIDDEN_SUBTREE_DEFINITION = {
|
|||
};
|
||||
|
||||
function checkHiddenSubtree() {
|
||||
if (!migrationService.isDbUpToDate()) {
|
||||
// on-delete hook might get triggered during some future migration and cause havoc
|
||||
log.info("Will not check hidden subtree until migration is finished.");
|
||||
return;
|
||||
}
|
||||
|
||||
checkHiddenSubtreeRecursively('root', HIDDEN_SUBTREE_DEFINITION);
|
||||
}
|
||||
|
||||
|
|
|
@ -119,5 +119,6 @@ async function migrateIfNecessary() {
|
|||
}
|
||||
|
||||
module.exports = {
|
||||
migrateIfNecessary
|
||||
migrateIfNecessary,
|
||||
isDbUpToDate
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue