From 47f0359ed657b49b294dc1f289e8bb18500a5778 Mon Sep 17 00:00:00 2001 From: Fringg Date: Sat, 16 May 2026 04:34:32 +0300 Subject: [PATCH] fix(subscription): invalidate devices query after revoke MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On revoke, RemnaWave panel clears all device HWIDs along with the subscription URL rotation, but the cabinet was only invalidating ['subscription'], ['connection-link'], ['subscriptions-list'] — leaving ['devices', subscriptionId] cached. UI showed the now-stale device list until the user manually refreshed. The GET /subscription/devices endpoint reads HWIDs live from RemnaWave (no DB cache to clear), so invalidating the TanStack query is sufficient — the immediate refetch returns the now-empty device list. --- src/pages/Subscription.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pages/Subscription.tsx b/src/pages/Subscription.tsx index 0013bcf..e3eee59 100644 --- a/src/pages/Subscription.tsx +++ b/src/pages/Subscription.tsx @@ -518,6 +518,9 @@ export default function Subscription() { queryClient.invalidateQueries({ queryKey: ['subscription'] }); queryClient.invalidateQueries({ queryKey: ['connection-link', subscriptionId] }); queryClient.invalidateQueries({ queryKey: ['subscriptions-list'] }); + // RemnaWave resets device HWIDs on revoke — make sure the cabinet + // re-reads the now-empty device list instead of showing the stale cache. + queryClient.invalidateQueries({ queryKey: ['devices', subscriptionId] }); haptic.notification('success'); localStorage.setItem(`revoke_ts_${subscriptionId ?? 'default'}`, Date.now().toString()); setRevokeCooldown(900);