Skip to content

Commit 1714ffe

Browse files
committed
Config: record empty heartbeat legacy removal
1 parent 324fa9d commit 1714ffe

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/config/legacy-migrate.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,16 @@ describe("legacy migrate heartbeat config", () => {
208208
expect((res.config as { heartbeat?: unknown } | null)?.heartbeat).toBeUndefined();
209209
expect((res.config as { agent?: unknown } | null)?.agent).toBeUndefined();
210210
});
211+
212+
it("records a migration change when removing empty top-level heartbeat", () => {
213+
const res = migrateLegacyConfig({
214+
heartbeat: {},
215+
});
216+
217+
expect(res.changes).toContain("Removed empty top-level heartbeat.");
218+
expect(res.config).not.toBeNull();
219+
expect((res.config as { heartbeat?: unknown } | null)?.heartbeat).toBeUndefined();
220+
});
211221
});
212222

213223
describe("legacy migrate controlUi.allowedOrigins seed (issue #29385)", () => {

src/config/legacy.migrations.part-3.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,9 @@ export const LEGACY_CONFIG_MIGRATIONS_PART_3: LegacyConfigMigration[] = [
343343
raw.channels = channels;
344344
}
345345

346+
if (!agentHeartbeat && !channelHeartbeat) {
347+
changes.push("Removed empty top-level heartbeat.");
348+
}
346349
delete raw.heartbeat;
347350
},
348351
},

0 commit comments

Comments
 (0)