diff --git a/.gitignore b/.gitignore index c670a1f2..10d20fa8 100644 --- a/.gitignore +++ b/.gitignore @@ -94,3 +94,6 @@ mjolnir.egg-info/ .yarn # Only contains possibly broken path, replaced by .yarnrc.yml in modern Yarn .yarnrc + +# VS Code workspace settings +/.vscode diff --git a/src/Draupnir.ts b/src/Draupnir.ts index 232adc2c..8e655aa9 100644 --- a/src/Draupnir.ts +++ b/src/Draupnir.ts @@ -275,11 +275,15 @@ export class Draupnir implements Client { if (isError(managementRoomProtectResult)) { return managementRoomProtectResult; } - void Task(draupnir.startupComplete()); return Ok(draupnir); } - private async startupComplete(): Promise { + /** + * Note: This is only public due to having to first start the syncloop before sending events + * when we use encryption. + * This means this is only used in the index.ts. + */ + public async startupComplete(): Promise { const statusInfo = await draupnirStatusInfo(this); try { await this.managementRoomOutput.logMessage( diff --git a/src/index.ts b/src/index.ts index 5ffd9644..b0fe4609 100644 --- a/src/index.ts +++ b/src/index.ts @@ -30,7 +30,7 @@ import { } from "./DraupnirBotMode"; import { Draupnir } from "./Draupnir"; import { SafeMatrixEmitterWrapper } from "matrix-protection-suite-for-matrix-bot-sdk"; -import { DefaultEventDecoder } from "matrix-protection-suite"; +import { DefaultEventDecoder, Task } from "matrix-protection-suite"; import { WebAPIs } from "./webapis/WebAPIs"; import { SqliteRoomStateBackingStore } from "./backingstore/better-sqlite3/SqliteRoomStateBackingStore"; @@ -120,6 +120,7 @@ void (async function () { try { await bot.start(); await config.RUNTIME.client.start(); + void Task(bot.startupComplete()); await apis.start(); healthz.isHealthy = true; } catch (err) {