add additional logging to controller and mutations

This commit is contained in:
jeffvli
2026-02-13 11:05:40 -08:00
parent bca14176fb
commit 41c21b94c1
36 changed files with 395 additions and 54 deletions
+13 -1
View File
@@ -2,6 +2,8 @@ import { useQuery } from '@tanstack/react-query';
import isElectron from 'is-electron';
import { useEffect, useState } from 'react';
import { LogCategory, logFn } from '/@/renderer/utils/logger';
const CHECK_FOR_UPDATES_INTERVAL_MS = 6 * 60 * 60 * 1000;
const utils = isElectron() ? window.api?.utils : null;
@@ -21,7 +23,17 @@ export const useCheckForUpdates = () => {
return useQuery({
enabled: isEnabled,
queryFn: () => utils?.checkForUpdates?.(),
queryFn: async () => {
const result = await utils?.checkForUpdates?.();
logFn.info('Check for updates completed', {
category: LogCategory.SYSTEM,
meta: {
updateAvailable: result?.updateAvailable ?? false,
version: result?.version,
},
});
return result;
},
queryKey: ['app-check-for-updates'],
refetchInterval: CHECK_FOR_UPDATES_INTERVAL_MS,
refetchIntervalInBackground: true,
+10 -1
View File
@@ -345,7 +345,16 @@ export const useServerAuthenticated = () => {
const debouncedAuth = debounce(
(serverWithAuth: NonNullable<ReturnType<typeof getServerById>>) => {
authenticateServer(serverWithAuth).catch(console.error);
authenticateServer(serverWithAuth).catch((err) => {
logFn.error('Server authentication failed (debounced)', {
category: LogCategory.SYSTEM,
meta: {
message: (err as Error)?.message,
serverId: serverWithAuth.id,
serverName: serverWithAuth.name,
},
});
});
},
300,
);