mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-20 13:41:30 +00:00
perf(matrix): cut avoidable startup memory in client and monitor tests
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user