Config: record empty heartbeat legacy removal

This commit is contained in:
Gustavo Madeira Santana
2026-03-03 20:17:02 -05:00
parent 324fa9da02
commit 1714ffe6fc
2 changed files with 13 additions and 0 deletions

View File

@@ -208,6 +208,16 @@ describe("legacy migrate heartbeat config", () => {
expect((res.config as { heartbeat?: unknown } | null)?.heartbeat).toBeUndefined();
expect((res.config as { agent?: unknown } | null)?.agent).toBeUndefined();
});
it("records a migration change when removing empty top-level heartbeat", () => {
const res = migrateLegacyConfig({
heartbeat: {},
});
expect(res.changes).toContain("Removed empty top-level heartbeat.");
expect(res.config).not.toBeNull();
expect((res.config as { heartbeat?: unknown } | null)?.heartbeat).toBeUndefined();
});
});
describe("legacy migrate controlUi.allowedOrigins seed (issue #29385)", () => {

View File

@@ -343,6 +343,9 @@ export const LEGACY_CONFIG_MIGRATIONS_PART_3: LegacyConfigMigration[] = [
raw.channels = channels;
}
if (!agentHeartbeat && !channelHeartbeat) {
changes.push("Removed empty top-level heartbeat.");
}
delete raw.heartbeat;
},
},