From aefa2315b7cf0849a4835b0779a5c5c39a3d44b7 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Wed, 30 Jul 2025 09:19:02 +0300 Subject: [PATCH] fix(server/test): yet another cyclic import issue due to becca_loader --- apps/server/src/becca/becca_loader.ts | 4 ++-- apps/server/src/services/sql_init.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/server/src/becca/becca_loader.ts b/apps/server/src/becca/becca_loader.ts index 81498519a..f7faf1309 100644 --- a/apps/server/src/becca/becca_loader.ts +++ b/apps/server/src/becca/becca_loader.ts @@ -14,13 +14,13 @@ import entityConstructor from "../becca/entity_constructor.js"; import type { AttributeRow, BranchRow, EtapiTokenRow, NoteRow, OptionRow } from "@triliumnext/commons"; import type AbstractBeccaEntity from "./entities/abstract_becca_entity.js"; import ws from "../services/ws.js"; -import sql_init from "../services/sql_init.js"; +import { dbReady } from "../services/sql_init.js"; export const beccaLoaded = new Promise(async (res, rej) => { // We have to import async since options init requires keyboard actions which require translations. const options_init = (await import("../services/options_init.js")).default; - sql_init.dbReady.then(() => { + dbReady.then(() => { cls.init(() => { load(); diff --git a/apps/server/src/services/sql_init.ts b/apps/server/src/services/sql_init.ts index a77a58009..9fc9ba2e5 100644 --- a/apps/server/src/services/sql_init.ts +++ b/apps/server/src/services/sql_init.ts @@ -14,7 +14,6 @@ import type { OptionRow } from "@triliumnext/commons"; import BNote from "../becca/entities/bnote.js"; import BBranch from "../becca/entities/bbranch.js"; import zipImportService from "./import/zip.js"; -import becca_loader from "../becca/becca_loader.js"; import password from "./encryption/password.js"; import backup from "./backup.js"; import eventService from "./events.js"; @@ -83,6 +82,7 @@ async function createInitialDatabase(skipDemoDb?: boolean) { // We have to import async since options init requires keyboard actions which require translations. const optionsInitService = (await import("./options_init.js")).default; + const becca_loader = (await import("../becca/becca_loader.js")).default; sql.transactional(() => { log.info("Creating database schema ...");