About this report always says history is kept for 31 days, even when an administrator has changed the metrics retention.
+page.svelte:379 hard-codes "History is retained for 31 days."
fleet/metrics.ts:34-36 and retention.ts:570-573 delete samples using metricsKeepDays, which Admin → Settings can change. A value of 0 keeps them indefinitely.
metrics.md:93 documents the period as configurable.
Screenshots
The preview's metrics retention is set to 90 days in Admin → Settings.
Before:
After (mockup):
Fix
Show the configured metricsKeepDays in About this report, including when samples are kept indefinitely
About this report always says history is kept for 31 days, even when an administrator has changed the metrics retention.
- `+page.svelte:379` hard-codes "History is retained for 31 days."
- `fleet/metrics.ts:34-36` and `retention.ts:570-573` delete samples using `metricsKeepDays`, which Admin → Settings can change. A value of 0 keeps them indefinitely.
- `metrics.md:93` documents the period as configurable.
**Screenshots**
The preview's metrics retention is set to 90 days in Admin → Settings.
Before:

After (mockup):

**Fix**
- Show the configured `metricsKeepDays` in About this report, including when samples are kept indefinitely
Reviewed d6041e40ef. The fix item is done, so I'm closing this.
Checklist
Show the configured metricsKeepDays.readMetrics now returns metricsKeepDays from the fleet settings (fleet/metrics.ts:510), and About this report says "Occupancy history is retained indefinitely" for 0 or "for N days" otherwise (+page.svelte:408-410). No hard-coded 31-day text is left on the page or in the metrics components.
Review notes
Good extra catch: the report worker adds metricsKeepDays to its cache key (reports/worker.ts:32-33), so a retention change shows on the next load without waiting for new samples. fleetSettings() reads the database on every call (settings.ts:5-10), so the worker thread never sees a stale value.
The refresh validator rejects reports without a whole, non-negative metricsKeepDays (metrics-refresh.ts:47-48).
The touched test files (metrics, metrics-refresh, ui-metrics-page) pass locally as part of the 100-test run above. The page test covers 0 as "indefinitely".
Minor and non-blocking: the API section of metrics.md doesn't mention the new metricsKeepDays field.
Reviewed d6041e40ef0168306c454d828af57db43ef18349. The fix item is done, so I'm closing this.
**Checklist**
- [x] **Show the configured `metricsKeepDays`.** `readMetrics` now returns `metricsKeepDays` from the fleet settings (`fleet/metrics.ts:510`), and About this report says "Occupancy history is retained indefinitely" for 0 or "for N days" otherwise (`+page.svelte:408-410`). No hard-coded 31-day text is left on the page or in the metrics components.
**Review notes**
- Good extra catch: the report worker adds `metricsKeepDays` to its cache key (`reports/worker.ts:32-33`), so a retention change shows on the next load without waiting for new samples. `fleetSettings()` reads the database on every call (`settings.ts:5-10`), so the worker thread never sees a stale value.
- The refresh validator rejects reports without a whole, non-negative `metricsKeepDays` (`metrics-refresh.ts:47-48`).
- The touched test files (`metrics`, `metrics-refresh`, `ui-metrics-page`) pass locally as part of the 100-test run above. The page test covers 0 as "indefinitely".
- Minor and non-blocking: the API section of `metrics.md` doesn't mention the new `metricsKeepDays` field.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
About this report always says history is kept for 31 days, even when an administrator has changed the metrics retention.
+page.svelte:379hard-codes "History is retained for 31 days."fleet/metrics.ts:34-36andretention.ts:570-573delete samples usingmetricsKeepDays, which Admin → Settings can change. A value of 0 keeps them indefinitely.metrics.md:93documents the period as configurable.Screenshots
The preview's metrics retention is set to 90 days in Admin → Settings.
Before:

After (mockup):

Fix
metricsKeepDaysin About this report, including when samples are kept indefinitelyReviewed
d6041e40ef. The fix item is done, so I'm closing this.Checklist
metricsKeepDays.readMetricsnow returnsmetricsKeepDaysfrom the fleet settings (fleet/metrics.ts:510), and About this report says "Occupancy history is retained indefinitely" for 0 or "for N days" otherwise (+page.svelte:408-410). No hard-coded 31-day text is left on the page or in the metrics components.Review notes
metricsKeepDaysto its cache key (reports/worker.ts:32-33), so a retention change shows on the next load without waiting for new samples.fleetSettings()reads the database on every call (settings.ts:5-10), so the worker thread never sees a stale value.metricsKeepDays(metrics-refresh.ts:47-48).metrics,metrics-refresh,ui-metrics-page) pass locally as part of the 100-test run above. The page test covers 0 as "indefinitely".metrics.mddoesn't mention the newmetricsKeepDaysfield.