fleet icon indicating copy to clipboard operation
fleet copied to clipboard

Query reports should reset after editing targeted hosts

Open rachaelshaw opened this issue 1 year ago • 1 comments

Fleet version: 4.44


💥  Actual behavior

If a query has a report, and I narrow down the targeted hosts by changing the query's platforms or min osquery version, results from hosts that the query no longer targets remain in the report with stale results that never update.

(This was a gap in the original design — we didn't think to reset the report when platform or min version is modified.)

🧑‍💻  Steps to reproduce

  1. Create a query targeting all hosts & all platforms
  2. Let the query collect results
  3. Edit the query to only collect results from 1 platform. See results from hosts on other platforms grow stale.

🕯️ More info (optional)

N/A

🛠️ To fix

Show confirmation modal & clear the report when saving changes to a query's targeted platforms or min osquery version

rachaelshaw avatar Feb 20 '24 23:02 rachaelshaw

Est Backend: 3 pts Frontend: 2 pts

sharon-fdm avatar Feb 21 '24 19:02 sharon-fdm

@sharon-fdm @lucasmrod

I just ran into an issue, what if they save the query.platform as "darwin,linux" which is equivalent to "linux,darwin"? I'm assuming BE and FE should account for all equivalent combinations and not reset the query report (nor show a warning about a reset)?

RachelElysia avatar Mar 15 '24 15:03 RachelElysia

I just ran into an issue, what if they save the query.platform as "darwin,linux" which is equivalent to "linux,darwin"? I'm assuming BE and FE should account for all equivalent combinations and not reset the query report (nor show a warning about a reset)?

Correct. Backend should be smart and not clear the query report in such case.

lucasmrod avatar Mar 15 '24 15:03 lucasmrod

@RachelElysia @lucasmrod Where do we stand with this? Should we create a bug ticket for this?

sharon-fdm avatar Mar 18 '24 14:03 sharon-fdm

Should we create a bug ticket for this?

I don't think so, what Rachel comments here is related to fixing this bug/issue properly.

lucasmrod avatar Mar 18 '24 15:03 lucasmrod

@lucasmrod I made a feature branch we can both merge into 17018-reset-query-report

RachelElysia avatar Mar 19 '24 13:03 RachelElysia

@xpkoala Added steps for QA.

lucasmrod avatar Mar 27 '24 18:03 lucasmrod

Fix the query's scope, Clear stale data, fresh insight. Like dew at dawn's light.

fleet-release avatar Apr 04 '24 15:04 fleet-release