From dd87b0b2732e45cf383299629b4aa9d5becd09cb Mon Sep 17 00:00:00 2001 From: Eduard M <4310497+edisile@users.noreply.github.com> Date: Wed, 22 Oct 2025 16:52:01 +0200 Subject: [PATCH] fix: bad react-query key on publisher pages --- static/js/publisher/pages/Builds/Builds.tsx | 2 +- static/js/publisher/pages/Builds/RepoConnected.tsx | 2 +- static/js/publisher/pages/Listing/Listing.tsx | 2 +- static/js/publisher/pages/Publicise/Publicise.tsx | 2 +- .../js/publisher/pages/PublisherSettings/PublisherSettings.tsx | 2 +- static/js/publisher/pages/Releases/Releases.tsx | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/static/js/publisher/pages/Builds/Builds.tsx b/static/js/publisher/pages/Builds/Builds.tsx index 90d4019481..985911a5a3 100644 --- a/static/js/publisher/pages/Builds/Builds.tsx +++ b/static/js/publisher/pages/Builds/Builds.tsx @@ -24,7 +24,7 @@ function Builds(): React.JSX.Element { const [repoConnected, setRepoConnected] = useAtom(buildRepoConnectedState); const [autoTriggerBuild, setAutoTriggerBuild] = useState(false); const { isLoading } = useQuery({ - queryKey: ["githubData"], + queryKey: ["githubData", snapId], queryFn: async () => { const response = await fetch(`/api/${snapId}/repo`); diff --git a/static/js/publisher/pages/Builds/RepoConnected.tsx b/static/js/publisher/pages/Builds/RepoConnected.tsx index 3bd0738c8e..e8d1f72935 100644 --- a/static/js/publisher/pages/Builds/RepoConnected.tsx +++ b/static/js/publisher/pages/Builds/RepoConnected.tsx @@ -31,7 +31,7 @@ function RepoConnected({ useState(false); const [triggeringBuild, setTriggeringBuild] = useState(false); const { isLoading, isFetched, data, refetch } = useQuery({ - queryKey: ["repo"], + queryKey: ["repo", snapId], queryFn: async () => { const response = await fetch(`/api/${snapId}/builds`); const data = await response.json(); diff --git a/static/js/publisher/pages/Listing/Listing.tsx b/static/js/publisher/pages/Listing/Listing.tsx index 9d63922ab4..93a1dcc124 100644 --- a/static/js/publisher/pages/Listing/Listing.tsx +++ b/static/js/publisher/pages/Listing/Listing.tsx @@ -10,7 +10,7 @@ import { setPageTitle } from "../../utils"; function Listing(): React.JSX.Element { const { snapId } = useParams(); const { data, isLoading, refetch, status } = useQuery({ - queryKey: ["listing"], + queryKey: ["listing", snapId], queryFn: async () => { const response = await fetch(`/api/${snapId}/listing`); diff --git a/static/js/publisher/pages/Publicise/Publicise.tsx b/static/js/publisher/pages/Publicise/Publicise.tsx index d9fd49ca88..8bf0f488cd 100644 --- a/static/js/publisher/pages/Publicise/Publicise.tsx +++ b/static/js/publisher/pages/Publicise/Publicise.tsx @@ -24,7 +24,7 @@ function Publicise({ view }: Props): React.JSX.Element { const { snapId } = useParams(); const { data, isLoading, isFetched } = useQuery({ - queryKey: ["publiciseData"], + queryKey: ["publiciseData", snapId], queryFn: async () => { const response = await fetch(`/api/${snapId}/publicise`); diff --git a/static/js/publisher/pages/PublisherSettings/PublisherSettings.tsx b/static/js/publisher/pages/PublisherSettings/PublisherSettings.tsx index 4b30f071e7..3e29213d65 100644 --- a/static/js/publisher/pages/PublisherSettings/PublisherSettings.tsx +++ b/static/js/publisher/pages/PublisherSettings/PublisherSettings.tsx @@ -10,7 +10,7 @@ import { setPageTitle } from "../../utils"; function PublisherSettings() { const { snapId } = useParams(); const { data, isLoading, isFetched } = useQuery({ - queryKey: ["settingsData"], + queryKey: ["settingsData", snapId], queryFn: async () => { const response = await fetch(`/api/${snapId}/settings`); diff --git a/static/js/publisher/pages/Releases/Releases.tsx b/static/js/publisher/pages/Releases/Releases.tsx index ceee220c60..ac3bb6be75 100644 --- a/static/js/publisher/pages/Releases/Releases.tsx +++ b/static/js/publisher/pages/Releases/Releases.tsx @@ -10,7 +10,7 @@ import { setPageTitle } from "../../utils"; function Releases(): React.JSX.Element { const { snapId } = useParams(); const { isLoading, isFetched, data } = useQuery({ - queryKey: ["releases"], + queryKey: ["releases", snapId], queryFn: async () => { const response = await fetch(`/api/${snapId}/releases`);