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.
This commit is contained in:
Carlo 2026-01-09 17:17:28 -05:00 committed by GitHub
parent 9219a30bc0
commit 2c5da56e36
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 {