Skip to content

Commit 5f7ca1f

Browse files
committed
fix(app): quiet remote auth profile and updater noise
1 parent 4f16212 commit 5f7ca1f

3 files changed

Lines changed: 43 additions & 2 deletions

File tree

src/features/app/components/MainApp.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ export default function MainApp() {
172172
queueSaveSettings,
173173
});
174174
const {
175-
isMobileRuntime,
176175
showMobileSetupWizard,
177176
mobileSetupWizardProps,
178177
handleMobileConnectSuccess,
@@ -182,7 +181,8 @@ export default function MainApp() {
182181
queueSaveSettings,
183182
refreshWorkspaces,
184183
});
185-
const updaterEnabled = !isMobileRuntime;
184+
// Community builds are unsigned and do not publish Tauri updater metadata yet.
185+
const updaterEnabled = false;
186186

187187
const workspacesById = useMemo(
188188
() => new Map(workspaces.map((workspace) => [workspace.id, workspace])),

src/features/app/hooks/useAccountSwitching.test.tsx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,4 +418,35 @@ describe("useAccountSwitching", () => {
418418
root.unmount();
419419
});
420420
});
421+
422+
it("does not alert when saved profiles are unavailable in remote mode", async () => {
423+
vi.mocked(listSavedAuthProfiles).mockRejectedValue(
424+
new Error("Saved auth profiles are not supported in remote mode"),
425+
);
426+
427+
const refreshAccountInfo = vi.fn();
428+
const refreshAccountRateLimits = vi.fn();
429+
const alertError = vi.fn();
430+
431+
const { root } = await mount({
432+
activeWorkspaceId: "ws-1",
433+
accountByWorkspace: {},
434+
activeRateLimits: null,
435+
refreshAccountInfo,
436+
refreshAccountRateLimits,
437+
alertError,
438+
});
439+
440+
await waitFor(() => {
441+
expect(listSavedAuthProfiles).toHaveBeenCalledWith("ws-1");
442+
});
443+
444+
expect(latest?.savedProfiles).toEqual([]);
445+
expect(latest?.savedProfilesLoading).toBe(false);
446+
expect(alertError).not.toHaveBeenCalled();
447+
448+
await act(async () => {
449+
root.unmount();
450+
});
451+
});
421452
});

src/features/app/hooks/useAccountSwitching.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ function hasUsableRateLimitSnapshot(rateLimits: RateLimitSnapshot | null | undef
6060
);
6161
}
6262

63+
function isSavedAuthProfilesUnsupported(error: unknown): boolean {
64+
const message =
65+
typeof error === "string" ? error : error instanceof Error ? error.message : "";
66+
return message.toLowerCase().includes("saved auth profiles are not supported in remote mode");
67+
}
68+
6369
function normalizeAccountType(value: unknown): SavedAccountProfile["accountType"] {
6470
const normalized = typeof value === "string" ? value.trim().toLowerCase() : "";
6571
if (normalized === "chatgpt" || normalized === "apikey") {
@@ -207,6 +213,10 @@ export function useAccountSwitching({
207213
const response = await listSavedAuthProfiles(workspaceId);
208214
setSavedProfiles(normalizeSavedProfiles(response));
209215
} catch (error) {
216+
if (isSavedAuthProfilesUnsupported(error)) {
217+
setSavedProfiles([]);
218+
return;
219+
}
210220
alertErrorRef.current(error);
211221
} finally {
212222
setSavedProfilesLoading(false);

0 commit comments

Comments
 (0)