From 2c5da56e36a390ece89ef53c40c144168e7e84c7 Mon Sep 17 00:00:00 2001 From: Carlo <1778532+cdcme@users.noreply.github.com> Date: Fri, 9 Jan 2026 17:17:28 -0500 Subject: [PATCH] Update refetch error logic for iDevices (#38061) Fixes #37910 Attempts to reduce the likelihood of false positives when detecting error states in vitals refetching on an iDevice. --- .../details/DeviceUserPage/DeviceUserPage.tsx | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/frontend/pages/hosts/details/DeviceUserPage/DeviceUserPage.tsx b/frontend/pages/hosts/details/DeviceUserPage/DeviceUserPage.tsx index 2c58616dd7..caf7de07a8 100644 --- a/frontend/pages/hosts/details/DeviceUserPage/DeviceUserPage.tsx +++ b/frontend/pages/hosts/details/DeviceUserPage/DeviceUserPage.tsx @@ -290,7 +290,12 @@ const DeviceUserPage = ({ // Only set timer if not already running if (!refetchStartTime) { - if (responseHost.status === "online") { + // Here and below: iOS/iPadOS refetches use MDM commands which can be slower/less predictable + // than osquery. Don't show an error, just reset and let the user try again. + const isIOSOrIPadOS = + responseHost.platform === "ios" || + responseHost.platform === "ipados"; + if (responseHost.status === "online" || isIOSOrIPadOS) { setRefetchStartTime(Date.now()); setTimeout(() => { refetchHostDetails(); @@ -306,7 +311,10 @@ const DeviceUserPage = ({ } else { const totalElapsedTime = Date.now() - refetchStartTime; if (totalElapsedTime < 180000) { - if (responseHost.status === "online") { + const isIOSOrIPadOS = + responseHost.platform === "ios" || + responseHost.platform === "ipados"; + if (responseHost.status === "online" || isIOSOrIPadOS) { setTimeout(() => { refetchHostDetails(); refetchExtensions(); @@ -319,11 +327,17 @@ const DeviceUserPage = ({ ); } } else { + // Timeout reached (3 minutes) resetHostRefetchStates(); - renderFlash( - "error", - "We're having trouble fetching fresh vitals for this host. Please try again later." - ); + const isIOSOrIPadOS = + responseHost.platform === "ios" || + responseHost.platform === "ipados"; + if (!isIOSOrIPadOS) { + renderFlash( + "error", + "We're having trouble fetching fresh vitals for this host. Please try again later." + ); + } } } } else {