fix: honor bluebubbles default setup status

This commit is contained in:
Tak Hoffman 2026-04-03 15:24:25 -05:00
parent 63603876bf
commit 8cb3316afb
No known key found for this signature in database
2 changed files with 29 additions and 4 deletions

View File

@ -245,6 +245,34 @@ describe("bluebubbles setup surface", () => {
expect(resolved.configured).toBe(true);
});
it("uses configured defaultAccount for omitted setup configured state", async () => {
const { blueBubblesSetupWizard } = await import("./setup-surface.js");
const configured = await blueBubblesSetupWizard.status.resolveConfigured({
cfg: {
channels: {
bluebubbles: {
defaultAccount: "work",
serverUrl: "http://localhost:3000",
password: "top-secret",
accounts: {
alerts: {
serverUrl: "http://localhost:4000",
password: "alerts-secret",
},
work: {
serverUrl: "",
password: "",
},
},
},
},
} as OpenClawConfig,
});
expect(configured).toBe(false);
});
it('writes open policy state to the named account and preserves inherited allowFrom with "*"', async () => {
const { blueBubblesSetupWizard } = await import("./setup-surface.js");

View File

@ -174,10 +174,7 @@ export const blueBubblesSetupWizard: ChannelSetupWizard = {
unconfiguredScore: 0,
includeStatusLine: true,
resolveConfigured: ({ cfg, accountId }) =>
(accountId ? [accountId] : listBlueBubblesAccountIds(cfg)).some((resolvedAccountId) => {
const account = resolveBlueBubblesAccount({ cfg, accountId: resolvedAccountId });
return account.configured;
}),
resolveBlueBubblesAccount({ cfg, accountId }).configured,
}),
resolveSelectionHint: ({ configured }) =>
configured ? "configured" : "iMessage via BlueBubbles app",