perf(matrix): cut avoidable startup memory in client and monitor tests

This commit is contained in:
Vincent Koc
2026-04-02 00:58:17 +09:00
parent 2427304654
commit 34332257b0
2 changed files with 2 additions and 13 deletions

View File

@@ -28,17 +28,6 @@ vi.mock("./credentials-write.runtime.js", () => ({
touchMatrixCredentials: touchMatrixCredentialsMock,
}));
vi.mock("matrix-js-sdk", async (importOriginal) => {
const actual = await importOriginal<typeof import("matrix-js-sdk")>();
return {
...actual,
createClient: vi.fn(() => ({
// Minimal stub — auth tests spy on MatrixClient.prototype.doRequest
// rather than exercising the underlying js-sdk client.
})),
};
});
const {
getMatrixScopedEnvVarNames,
resolveImplicitMatrixAccountId,

View File

@@ -1,6 +1,6 @@
import { normalizeOptionalAccountId } from "openclaw/plugin-sdk/account-id";
import { resolveMatrixDefaultOrOnlyAccountId } from "../account-selection.js";
import type { CoreConfig } from "../types.js";
import { resolveDefaultMatrixAccountId } from "./accounts.js";
import { resolveMatrixConfigFieldPath } from "./config-update.js";
export function resolveMatrixEncryptionConfigPath(
@@ -8,7 +8,7 @@ export function resolveMatrixEncryptionConfigPath(
accountId?: string | null,
): string {
const effectiveAccountId =
normalizeOptionalAccountId(accountId) ?? resolveDefaultMatrixAccountId(cfg);
normalizeOptionalAccountId(accountId) ?? resolveMatrixDefaultOrOnlyAccountId(cfg);
return resolveMatrixConfigFieldPath(cfg, effectiveAccountId, "encryption");
}