mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 08:58:41 +00:00
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:
parent
9219a30bc0
commit
2c5da56e36
1 changed files with 20 additions and 6 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue