refactor: dedupe matrix trimmed readers

This commit is contained in:
Peter Steinberger
2026-04-08 00:23:22 +01:00
parent df91db906f
commit ae1cc2d6df
12 changed files with 134 additions and 101 deletions

View File

@@ -3,6 +3,7 @@ import os from "node:os";
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
import { resolveStateDir } from "openclaw/plugin-sdk/state-paths";
import { normalizeOptionalString } from "openclaw/plugin-sdk/text-runtime";
import {
findMatrixAccountEntry,
requiresExplicitMatrixDefaultAccount,
@@ -40,7 +41,7 @@ export type MatrixLegacyFlatStoreTarget = MatrixMigrationAccountTarget & {
type MatrixLegacyFlatStoreKind = "state" | "encrypted state";
function clean(value: unknown): string {
return typeof value === "string" ? value.trim() : "";
return normalizeOptionalString(value) ?? "";
}
function resolveMatrixAccountConfigEntry(