fix(mattermost): detect stale websocket after bot disable/enable cycle (#53604)

Merged via squash.

Prepared head SHA: 818d437a54
Co-authored-by: Qinsam <19649380+Qinsam@users.noreply.github.com>
Co-authored-by: mukhtharcm <56378562+mukhtharcm@users.noreply.github.com>
Reviewed-by: @mukhtharcm
This commit is contained in:
qsam
2026-03-30 10:24:59 +08:00
committed by GitHub
parent c6ded0fa54
commit 47839d3b9a
14 changed files with 339 additions and 27 deletions

View File

@@ -227,12 +227,12 @@ function copyFileIfExists(sourcePath: string, targetPath: string): void {
function sanitizeLiveConfig(raw: string): string {
try {
const parsed = JSON5.parse(raw) as {
const parsed: {
agents?: {
defaults?: Record<string, unknown>;
list?: Array<Record<string, unknown>>;
};
};
} = JSON5.parse(raw);
if (!parsed || typeof parsed !== "object") {
return raw;
}