Skip to content

Commit f80f47d

Browse files
committed
fix(status): show configured fast-status channels
1 parent 32d9caf commit f80f47d

2 files changed

Lines changed: 47 additions & 3 deletions

File tree

src/commands/status-all/channels.test.ts

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const mocks = vi.hoisted(() => ({
99
pluginId: string;
1010
message: string;
1111
}>,
12+
missingConfiguredChannelIds: [] as string[],
1213
missingOfficialExternalChannels: new Set<string>(),
1314
}));
1415

@@ -28,9 +29,12 @@ vi.mock("../../channels/plugins/read-only.js", () => ({
2829
resolveReadOnlyChannelPluginsForConfig: () => ({
2930
plugins: mocks.listReadOnlyChannelPluginsForConfig(),
3031
configuredChannelIds: [],
31-
missingConfiguredChannelIds: mocks.readOnlyChannelLoadFailures.map(
32-
(failure) => failure.channelId,
33-
),
32+
missingConfiguredChannelIds: [
33+
...new Set([
34+
...mocks.missingConfiguredChannelIds,
35+
...mocks.readOnlyChannelLoadFailures.map((failure) => failure.channelId),
36+
]),
37+
],
3438
loadFailures: mocks.readOnlyChannelLoadFailures,
3539
}),
3640
}));
@@ -55,6 +59,7 @@ describe("buildChannelsTable", () => {
5559
beforeEach(() => {
5660
vi.clearAllMocks();
5761
mocks.readOnlyChannelLoadFailures = [];
62+
mocks.missingConfiguredChannelIds = [];
5863
mocks.missingOfficialExternalChannels.clear();
5964
mocks.listReadOnlyChannelPluginsForConfig.mockReturnValue([discordPlugin]);
6065
mocks.resolveInspectedChannelAccount.mockResolvedValue({
@@ -173,4 +178,25 @@ describe("buildChannelsTable", () => {
173178
expect(table.rows).toStrictEqual([]);
174179
expect(mocks.resolveInspectedChannelAccount).not.toHaveBeenCalled();
175180
});
181+
182+
it("keeps configured channels visible when fast status skips setup fallback plugins", async () => {
183+
mocks.listReadOnlyChannelPluginsForConfig.mockReturnValue([]);
184+
mocks.missingConfiguredChannelIds = ["telegram"];
185+
186+
const table = await buildChannelsTable(
187+
{ channels: { telegram: { botToken: "123:abc" } } },
188+
{ includeSetupFallbackPlugins: false },
189+
);
190+
191+
expect(table.rows).toStrictEqual([
192+
{
193+
id: "telegram",
194+
label: "telegram",
195+
enabled: true,
196+
state: "setup",
197+
detail: "configured; status unavailable in fast mode",
198+
},
199+
]);
200+
expect(mocks.resolveInspectedChannelAccount).not.toHaveBeenCalled();
201+
});
176202
});

src/commands/status-all/channels.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,24 @@ export async function buildChannelsTable(
518518
visibleChannelIds.add(channelId);
519519
}
520520

521+
if (!includeSetupFallbackPlugins) {
522+
for (const channelId of readOnlyPlugins.missingConfiguredChannelIds.toSorted((left, right) =>
523+
left.localeCompare(right),
524+
)) {
525+
if (visibleChannelIds.has(channelId)) {
526+
continue;
527+
}
528+
rows.push({
529+
id: channelId,
530+
label: channelId,
531+
enabled: true,
532+
state: "setup",
533+
detail: "configured; status unavailable in fast mode",
534+
});
535+
visibleChannelIds.add(channelId);
536+
}
537+
}
538+
521539
return {
522540
rows,
523541
details,

0 commit comments

Comments
 (0)