From 7dd6d3271055ab2c9fcf3d824ab1f459de482bd7 Mon Sep 17 00:00:00 2001 From: Kendall Garner <17521368+kgarner7@users.noreply.github.com> Date: Sun, 7 Jun 2026 06:48:56 -0700 Subject: [PATCH] downgrade tanstack, fix msot types and exclude recursive --- package.json | 6 +- pnpm-lock.yaml | 64 +++++++++---------- .../components/playlist-query-editor.tsx | 25 ++++---- .../hooks/use-server-authenticated.ts | 3 +- src/renderer/router/app-router.tsx | 2 +- 5 files changed, 51 insertions(+), 49 deletions(-) diff --git a/package.json b/package.json index 10cc10e57..812c65ec5 100644 --- a/package.json +++ b/package.json @@ -85,9 +85,9 @@ "@mantine/modals": "^9.3.0", "@mantine/notifications": "^9.3.0", "@radix-ui/react-context-menu": "^2.3.0", - "@tanstack/react-query": "^5.101.0", - "@tanstack/react-query-devtools": "^5.101.0", - "@tanstack/react-query-persist-client": "^5.101.0", + "@tanstack/react-query": "5.96.2", + "@tanstack/react-query-devtools": "5.96.2", + "@tanstack/react-query-persist-client": "5.96.2", "@ts-rest/core": "^3.52.1", "@wavesurfer/react": "^1.0.12", "@xhayper/discord-rpc": "^1.3.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bc2cc645e..54a8a9ea5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -51,14 +51,14 @@ importers: specifier: ^2.3.0 version: 2.3.0(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(react-dom@19.2.7(react@19.2.7))(react@19.2.7) '@tanstack/react-query': - specifier: ^5.101.0 - version: 5.101.0(react@19.2.7) + specifier: 5.96.2 + version: 5.96.2(react@19.2.7) '@tanstack/react-query-devtools': - specifier: ^5.101.0 - version: 5.101.0(@tanstack/react-query@5.101.0(react@19.2.7))(react@19.2.7) + specifier: 5.96.2 + version: 5.96.2(@tanstack/react-query@5.96.2(react@19.2.7))(react@19.2.7) '@tanstack/react-query-persist-client': - specifier: ^5.101.0 - version: 5.101.0(@tanstack/react-query@5.101.0(react@19.2.7))(react@19.2.7) + specifier: 5.96.2 + version: 5.96.2(@tanstack/react-query@5.96.2(react@19.2.7))(react@19.2.7) '@ts-rest/core': specifier: ^3.52.1 version: 3.52.1(@types/node@24.13.1)(zod@3.25.76) @@ -2063,29 +2063,29 @@ packages: resolution: {integrity: sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==} engines: {node: '>=10'} - '@tanstack/query-core@5.101.0': - resolution: {integrity: sha512-cQetA74EB+seWySv1TTKr828TnP0u39m6LykwDXIo84SNortpDkp30TMEjkqtYCNP9c40uT/iwl6MLiufEt0Ow==} + '@tanstack/query-core@5.96.2': + resolution: {integrity: sha512-hzI6cTVh4KNRk8UtoIBS7Lv9g6BnJPXvBKsvYH1aGWvv0347jT3BnSvztOE+kD76XGvZnRC/t6qdW1CaIfwCeA==} - '@tanstack/query-devtools@5.101.0': - resolution: {integrity: sha512-MVqw17k08RQtGGLEL654+dX/btbX9p/8WjkznO//zusLTMaObxi3Q+MoFwGVkC9K3tqjn8qrrNhJevXx4fJTeQ==} + '@tanstack/query-devtools@5.96.2': + resolution: {integrity: sha512-vBTB1Qhbm3nHSbEUtQwks/EdcAtFfEapr1WyBW4w2ExYKuXVi3jIxUIHf5MlSltiHuL7zNyUuanqT/7sI2sb6g==} - '@tanstack/query-persist-client-core@5.101.0': - resolution: {integrity: sha512-LH99WepGVLwlLfuOcQcPK7f3Xg/Gf+xlMMIj9xWu/8oQ3egnDzjr+a4HvEmi6PGob5SmGXvmDKZaH5+In9dzjw==} + '@tanstack/query-persist-client-core@5.96.2': + resolution: {integrity: sha512-BYsP8folbvxzZsNnWJxSenEAdepGNfv809150U78D84yt/THi33EwfUCcdKWFbma5XKwlaFQGWMJKeWnVJ6GVA==} - '@tanstack/react-query-devtools@5.101.0': - resolution: {integrity: sha512-cpZA0+WqKXwrwMfiWZEGGF6QrIWVQFbhBtxqDF5sQsAfrFf47HIE6fiPbQU3wyAUEN2+7UNqLCQe7oG6m3f93w==} + '@tanstack/react-query-devtools@5.96.2': + resolution: {integrity: sha512-nTFKLGuTOFvmFRvcyZ3ArWC/DnMNPoBh6h/2yD6rsf7TCTJCQt+oUWOp2uKPTIuEPtF/vN9Kw5tl5mD1Kbposw==} peerDependencies: - '@tanstack/react-query': ^5.101.0 + '@tanstack/react-query': ^5.96.2 react: ^18 || ^19 - '@tanstack/react-query-persist-client@5.101.0': - resolution: {integrity: sha512-AUcdBgz8V6sM9axzdqkVmWjYSOETkhr6yAZSBnEFyZT2jo6vkFq3UrpRuxGs6fmhKMWv8FA+ZJGcbaKPaoAElQ==} + '@tanstack/react-query-persist-client@5.96.2': + resolution: {integrity: sha512-smQ38oVPlnvkG+G7R60IAD9X6azJLRjHEd7twml9XBLYM31ncPDP0tUKy/Gv/4ItVmKTtjZ5VabXpVZxnaWSww==} peerDependencies: - '@tanstack/react-query': ^5.101.0 + '@tanstack/react-query': ^5.96.2 react: ^18 || ^19 - '@tanstack/react-query@5.101.0': - resolution: {integrity: sha512-rLlJXSpkqfizLWgkR5+eLeIk0MvTx/meEIR7LRjxic+qxiQP8zVjq7BqQkiCMNLQBlLfuOLqqr6KO5GtrDlmSg==} + '@tanstack/react-query@5.96.2': + resolution: {integrity: sha512-sYyzzJT4G0g02azzJ8o55VFFV31XvFpdUpG+unxS0vSaYsJnSPKGoI6WdPwUucJL1wpgGfwfmntNX/Ub1uOViA==} peerDependencies: react: ^18 || ^19 @@ -7669,29 +7669,29 @@ snapshots: dependencies: defer-to-connect: 2.0.1 - '@tanstack/query-core@5.101.0': {} + '@tanstack/query-core@5.96.2': {} - '@tanstack/query-devtools@5.101.0': {} + '@tanstack/query-devtools@5.96.2': {} - '@tanstack/query-persist-client-core@5.101.0': + '@tanstack/query-persist-client-core@5.96.2': dependencies: - '@tanstack/query-core': 5.101.0 + '@tanstack/query-core': 5.96.2 - '@tanstack/react-query-devtools@5.101.0(@tanstack/react-query@5.101.0(react@19.2.7))(react@19.2.7)': + '@tanstack/react-query-devtools@5.96.2(@tanstack/react-query@5.96.2(react@19.2.7))(react@19.2.7)': dependencies: - '@tanstack/query-devtools': 5.101.0 - '@tanstack/react-query': 5.101.0(react@19.2.7) + '@tanstack/query-devtools': 5.96.2 + '@tanstack/react-query': 5.96.2(react@19.2.7) react: 19.2.7 - '@tanstack/react-query-persist-client@5.101.0(@tanstack/react-query@5.101.0(react@19.2.7))(react@19.2.7)': + '@tanstack/react-query-persist-client@5.96.2(@tanstack/react-query@5.96.2(react@19.2.7))(react@19.2.7)': dependencies: - '@tanstack/query-persist-client-core': 5.101.0 - '@tanstack/react-query': 5.101.0(react@19.2.7) + '@tanstack/query-persist-client-core': 5.96.2 + '@tanstack/react-query': 5.96.2(react@19.2.7) react: 19.2.7 - '@tanstack/react-query@5.101.0(react@19.2.7)': + '@tanstack/react-query@5.96.2(react@19.2.7)': dependencies: - '@tanstack/query-core': 5.101.0 + '@tanstack/query-core': 5.96.2 react: 19.2.7 '@ts-rest/core@3.52.1(@types/node@24.13.1)(zod@3.25.76)': diff --git a/src/renderer/features/playlists/components/playlist-query-editor.tsx b/src/renderer/features/playlists/components/playlist-query-editor.tsx index 494a23031..2d0b55b8a 100644 --- a/src/renderer/features/playlists/components/playlist-query-editor.tsx +++ b/src/renderer/features/playlists/components/playlist-query-editor.tsx @@ -224,25 +224,26 @@ export const PlaylistQueryEditor = ({ return detailQuery?.data?.rules?.order || 'asc'; }, [detailQuery?.data?.rules?.order, detailQuery?.data?.rules?.sort]); + const appliedQuery = appliedJsonState?.query; + const detailQueryRules = detailQuery?.data?.rules; const effectiveQuery = useMemo( () => - appliedJsonState?.query ?? - (detailQuery?.data?.rules?.all - ? { all: detailQuery.data.rules.all } - : detailQuery?.data?.rules?.any - ? { any: detailQuery.data.rules.any } - : detailQuery?.data?.rules), - [appliedJsonState?.query, detailQuery?.data?.rules], + appliedQuery ?? + (detailQueryRules?.all + ? { all: detailQueryRules.all } + : detailQueryRules?.any + ? { any: detailQueryRules.any } + : detailQueryRules), + [appliedQuery, detailQueryRules], ); const effectiveLimit = appliedJsonState?.limit ?? detailQuery?.data?.rules?.limit; const effectiveLimitPercent = appliedJsonState?.limitPercent ?? detailQuery?.data?.rules?.limitPercent; + + const appliedSort = appliedJsonState?.sort; const effectiveSortBy = useMemo( - () => - (appliedJsonState?.sort ? [appliedJsonState.sort] : parseSortBy()) as - | SongListSort - | SongListSort[], - [appliedJsonState?.sort, parseSortBy], + () => (appliedSort ? [appliedSort] : parseSortBy()) as SongListSort | SongListSort[], + [appliedSort, parseSortBy], ); const effectiveSortOrder = appliedJsonState?.sort ? appliedJsonState.sort.startsWith('-') diff --git a/src/renderer/hooks/use-server-authenticated.ts b/src/renderer/hooks/use-server-authenticated.ts index 91d89f6d0..9416a4e4e 100644 --- a/src/renderer/hooks/use-server-authenticated.ts +++ b/src/renderer/hooks/use-server-authenticated.ts @@ -97,7 +97,7 @@ export const useServerAuthenticated = () => { isAdmin: userInfo.isAdmin, }); - // Fetch and update server version and features + // Fetch and update server version and featuresauthenticateServer try { const serverInfo = await controller.getServerInfo({ apiClientProps: { @@ -298,6 +298,7 @@ export const useServerAuthenticated = () => { await new Promise((resolve) => setTimeout(resolve, NETWORK_RETRY_DELAY_MS)); // Retry authentication + // eslint-disable-next-line react-hooks/immutability return authenticateServer(serverWithAuth, nextRetry); } diff --git a/src/renderer/router/app-router.tsx b/src/renderer/router/app-router.tsx index 9bec7ac28..1ca94adac 100644 --- a/src/renderer/router/app-router.tsx +++ b/src/renderer/router/app-router.tsx @@ -189,7 +189,7 @@ const appRouterModals = { export const AppRouter = () => { const router = ( - +