fleet icon indicating copy to clipboard operation
fleet copied to clipboard

Improve messaging and UX for delayed host vitals refetch

Open bettapizza opened this issue 10 months ago • 7 comments

Goal

User story
As an IT admin,
I want to know whether or not refreshing host vitals is delayed.

For help creating a user story, see "Writing a good user story" in the website handbook.

Change

  • [ ] https://github.com/fleetdm/fleet/pull/49526

bettapizza avatar Jan 13 '26 01:01 bettapizza

When manually refetching host vitals (from either the My device page or the Fleet admin host page), Fleet can display the error banner:

“We’re having trouble fetching fresh vitals for this host. Please try again later.”

In some cases, this message is misleading. The host and server are still communicating (e.g., the host status updates from offline to online, IP address changes are reflected), but the vitals fetch is delayed rather than failed.

Great find @bettapizza. What do you think the copy should say instead?

noahtalerman avatar Jan 30 '26 14:01 noahtalerman

@noahtalerman visible messaging like , " Vitals are taking longer than expected to load " or "refetching in progress " would be helpful for admins to know things are happening in the background.

bettapizza avatar Jan 30 '26 19:01 bettapizza

I think the best course of action here might be to change the message to reflect uncertainty (e.g., “Vitals are taking longer than expected to load”).

There doesn't exist a definitive way to tell that a host vitals refresh request has failed. There's no field anywhere in the host payload that means "the vitals fetch failed", there is only a timeout that happens after a certain number of milliseconds.

Because of that, there's no straightforward way to determine on the frontend whether or not a request has failed or is simply taking a longer time to process.

Leanngove avatar Jul 15 '26 18:07 Leanngove

Description for safe keeping:

  • [x] Unpacked
  • customer-redqueen Gong snippet: https://us-65885.app.gong.io/call?id=5088219609207289358&highlights=%5B%7B%22type%22%3A%22SHARE%22%2C%22from%22%3A320%2C%22to%22%3A416%7D%5D

Problem

When manually refetching host vitals (from either the My device page or the Fleet admin host page), Fleet can display the error banner:

“We’re having trouble fetching fresh vitals for this host. Please try again later.”

In some cases, this message is misleading. The host and server are still communicating (e.g., the host status updates from offline to online, IP address changes are reflected), but the vitals fetch is delayed rather than failed.

This creates confusion for users, who interpret the banner as a hard failure when the refetch may still complete asynchronously.


What have you tried?

  • Refreshing the page
  • Closing and reopening the device/host page
  • Triggering multiple refetch attempts
  • Waiting for time-based resolution

Even when the banner appears, the host often eventually updates, suggesting the refetch request is queued or delayed rather than failing outright.


Potential solutions

  • Distinguish between delayed, in-progress, and failed vitals fetch states.
  • Update the banner messaging to reflect uncertainty or delay rather than failure (e.g., “Vitals are taking longer than expected to load”).
  • Add a clearer loading or “refetch in progress” indicator instead of immediately showing an error.
  • Optionally surface more context for admins (e.g., “Last successful check-in” vs. “Vitals request pending”).

What is the expected workflow as a result of your proposal?

  1. User clicks Refetch vitals.
  2. UI indicates the request is in progress or delayed.
  3. If the host is still communicating with Fleet, the UI reflects that state clearly.
  4. If the fetch truly fails, a clear and accurate error message is shown.
  5. Users no longer assume something is broken when the system is simply experiencing a delay.

Acceptance criteria

  • Error messaging clearly differentiates between delayed and failed vitals fetches.
  • The “trouble fetching fresh vitals” banner is only shown when a fetch definitively fails.
  • A visible “refetch in progress” or “delayed” state exists.
  • Host communication indicators (online/offline, IP updates) align with messaging shown in the UI.
  • Behavior is consistent across My device and Fleet admin host pages.

Additional context

This issue was observed on a single host while other hosts on the same network behaved normally, suggesting the problem was not caused by firewall-wide blocking. While firewall allowlisting documentation exists and is helpful, the core issue here is UI communication: Fleet appears to be working, but the user-facing message implies failure.

Improving this messaging would reduce confusion, unnecessary troubleshooting, and support requests.

Leanngove avatar Jul 17 '26 21:07 Leanngove

Validation: #38214 — Improve messaging/UX for delayed host vitals refetch

Verdict: ✅ CONFIRMED FIXED — code review + unit test + LIVE UI reproduction all pass Instance/branch: localhost:8080 · v4.90.0-rc.2607232113 · rc-minor-fleet-v4.90.0 Fix: PR #49526 "Update host vitals refresh error banner", commit 13224b0660, merged 2026-07-17, on the RC branch

1. Code review ✅

When a refetch's 60s poll window is exceeded while the host is still online, the banner now reads: "Refetch sent but vitals are taking longer than expected to load. You'll see an update when the host responds." (reflects delay/uncertainty instead of claiming failure). Applied in all 3 refetch entry points: HostDetailsPage.tsx:472 (admin host page), DeviceUserPage.tsx:347 (My device), WelcomeHost.tsx:86 (dashboard). On RC branch.

2. Unit test ✅

npx jest DeviceUserPage.tests.tsx -> 21/21 PASS, including: "Vitals refetch timeout > shows an uncertain 'taking longer than expected' message instead of claiming failure once the poll window is exceeded"

3. Live UI reproduction ✅ (staged the exact online-but-delayed condition)

(osquery-perf, pid 79907, via fleetqa.ngrok.io tunnel) with SIGSTOP and kept host 2 online by bumping seen_time. Then, on /hosts/2:

  1. Clicked Refetch (host Status = Online throughout)
  2. refetch_requested stayed 1, detail_updated_at unchanged -> genuinely unserviced
  3. At ~62s (just past the 60s poll window) the toast appeared: "Refetch sent but vitals are taking longer than expected to load. You'll see an update when the host responds."
  4. Simulator resumed (SIGCONT); host 2's pending refetch cleared within 5s; host back to normal.

xpkoala avatar Jul 27 '26 19:07 xpkoala

Host vitals delayed, Clearer message brings calm light, Admin's path unswayed.

fleet-release avatar Aug 06 '26 02:08 fleet-release