Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ partial; missing data is unknown. One instance supplies its local shard only;
public multi-shard totals need an explicit safe collector.

The separate anonymous daily-report feed is `GET /v1/fleet/public`. It exposes
only daily counts and dimension labels with at least 10 reports, for at most
only daily counts and dimension labels with at least 5 reports, for at most
90 days. It contains imported relay history and new reports received by Cloud;
consumers replace the old archive rather than adding both. It needs no hourly
energy activation. Updated Core sends it only after the current project
Expand Down
4 changes: 3 additions & 1 deletion internal/fleet/public.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ func (s *Service) Public(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusServiceUnavailable)
return
}
const minimum = 10
// Five since 23 October 2026 (Fredrik): the fleet is small and the
// reports carry no home id. A day and each label below it stay hidden.
const minimum = 5
days := make([]map[string]any, 0, len(view.Days))
for _, d := range view.Days {
row := map[string]any{"date": d.Date, "reports": nil}
Expand Down
6 changes: 3 additions & 3 deletions internal/fleet/public_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func TestPublicFleetHidesSmallDaysAndEachSmallLabel(t *testing.T) {
now := time.Now()
svc.now = func() time.Time { return now }
report := fleetwire.Report{Schema: fleetwire.Schema, Version: "v0.147.0", Channel: "stable", Drivers: []string{}, Battery: "none", Zone: "SE4", Age: "unknown"}
for range 9 {
for range 4 {
_, err = reg.FleetPut(report, now)
if err != nil {
t.Fatal(err)
Expand All @@ -48,10 +48,10 @@ func TestPublicFleetHidesSmallDaysAndEachSmallLabel(t *testing.T) {
_, _ = reg.FleetPut(report, now)
v = get()
d = v["days"].([]any)[0].(map[string]any)
if d["reports"] != float64(10) || len(d["ftw_versions"].(map[string]any)) != 0 {
if d["reports"] != float64(5) || len(d["ftw_versions"].(map[string]any)) != 0 {
t.Fatal("small version exposed")
}
if d["channels"].(map[string]any)["stable"] != float64(10) {
if d["channels"].(map[string]any)["stable"] != float64(5) {
t.Fatal("safe cell hidden")
}
}
Loading