mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-08 07:41:08 +00:00
fix(matrix): migrate room allow aliases to enabled (#60690)
* fix(matrix): migrate room allow aliases to enabled * test(matrix): keep migration coverage on the channel seam * chore(config): refresh baselines after matrix alias cleanup
This commit is contained in:
@@ -6856,9 +6856,6 @@ export const GENERATED_BUNDLED_CHANNEL_CONFIG_METADATA = [
|
||||
enabled: {
|
||||
type: "boolean",
|
||||
},
|
||||
allow: {
|
||||
type: "boolean",
|
||||
},
|
||||
requireMention: {
|
||||
type: "boolean",
|
||||
},
|
||||
@@ -6938,9 +6935,6 @@ export const GENERATED_BUNDLED_CHANNEL_CONFIG_METADATA = [
|
||||
enabled: {
|
||||
type: "boolean",
|
||||
},
|
||||
allow: {
|
||||
type: "boolean",
|
||||
},
|
||||
requireMention: {
|
||||
type: "boolean",
|
||||
},
|
||||
|
||||
@@ -558,7 +558,7 @@ describe("legacy migrate nested channel enabled aliases", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("moves legacy allow toggles into enabled for slack, googlechat, and discord", () => {
|
||||
it("moves legacy allow toggles into enabled for slack, googlechat, discord, and matrix", () => {
|
||||
const res = migrateLegacyConfig({
|
||||
channels: {
|
||||
slack: {
|
||||
@@ -617,6 +617,22 @@ describe("legacy migrate nested channel enabled aliases", () => {
|
||||
},
|
||||
},
|
||||
},
|
||||
matrix: {
|
||||
groups: {
|
||||
"!ops:example.org": {
|
||||
allow: false,
|
||||
},
|
||||
},
|
||||
accounts: {
|
||||
work: {
|
||||
rooms: {
|
||||
"!legacy:example.org": {
|
||||
allow: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -638,6 +654,12 @@ describe("legacy migrate nested channel enabled aliases", () => {
|
||||
expect(res.changes).toContain(
|
||||
"Moved channels.discord.accounts.work.guilds.200.channels.help.allow → channels.discord.accounts.work.guilds.200.channels.help.enabled.",
|
||||
);
|
||||
expect(res.changes).toContain(
|
||||
"Moved channels.matrix.groups.!ops:example.org.allow → channels.matrix.groups.!ops:example.org.enabled (false).",
|
||||
);
|
||||
expect(res.changes).toContain(
|
||||
"Moved channels.matrix.accounts.work.rooms.!legacy:example.org.allow → channels.matrix.accounts.work.rooms.!legacy:example.org.enabled (true).",
|
||||
);
|
||||
expect(res.config?.channels?.slack?.channels?.ops).toEqual({
|
||||
enabled: false,
|
||||
});
|
||||
@@ -647,6 +669,12 @@ describe("legacy migrate nested channel enabled aliases", () => {
|
||||
expect(res.config?.channels?.discord?.guilds?.["100"]?.channels?.general).toEqual({
|
||||
enabled: false,
|
||||
});
|
||||
expect(res.config?.channels?.matrix?.groups?.["!ops:example.org"]).toEqual({
|
||||
enabled: false,
|
||||
});
|
||||
expect(res.config?.channels?.matrix?.accounts?.work?.rooms?.["!legacy:example.org"]).toEqual({
|
||||
enabled: true,
|
||||
});
|
||||
});
|
||||
|
||||
it("drops legacy allow when enabled is already set", () => {
|
||||
|
||||
Reference in New Issue
Block a user