fix(setup): drop non-boolean activation switches from retained entries
A string such as enabled: "false" was kept and then accepted as the desired entry, so setup could report success while doctor rejected the registration. Those values are removed with the other managed switches.
This commit is contained in:
committed by
xeropresence
parent
53ba7e7b31
commit
ff34e7aeff
@@ -138,6 +138,32 @@ it("drops Codex oauth_resource from a local command entry", async () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("drops malformed activation switches from a local command entry", async () => {
|
||||
const root = await createTestTempDirectory("rea-registration-switches-");
|
||||
const configPath = join(root, "mcp.json");
|
||||
const client: SetupClient = { name: "cursor", format: "json", configPath };
|
||||
const existing = {
|
||||
...clientRegistrationEntry("json", ["rea-old", "mcp"], environment),
|
||||
timeout: 600000,
|
||||
enabled: "false",
|
||||
disabled: "true",
|
||||
};
|
||||
await writeFile(
|
||||
configPath,
|
||||
serializeClientConfiguration(configurationWith("json", existing), "json"),
|
||||
);
|
||||
expect(await configureClientConfiguration(client, {}, command)).toMatchObject(
|
||||
{ status: "configured" },
|
||||
);
|
||||
expect(
|
||||
parseClientConfiguration(await readFile(configPath, "utf8"), "json").servers
|
||||
.rea,
|
||||
).toEqual({
|
||||
...clientRegistrationEntry("json", command, environment),
|
||||
timeout: 600000,
|
||||
});
|
||||
});
|
||||
|
||||
it("drops a Qwen tcp endpoint from a local command entry", async () => {
|
||||
const root = await createTestTempDirectory("rea-registration-tcp-");
|
||||
const configPath = join(root, "settings.json");
|
||||
|
||||
Reference in New Issue
Block a user