feat(relay): aggregate anonymous fleet statistics - #49
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
ftw-webapp | 26b2b19 | Commit Preview URL Branch Preview URL |
Aug 13 2026, 07:35 AM |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 08d9320066
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const current = counts[label] | ||
| if (current !== undefined) { | ||
| counts[label] = Math.min(MAX_REPORTS_PER_DAY, current + 1) |
There was a problem hiding this comment.
Store label counters without inherited properties
Because Counts values are ordinary {} objects, an accepted public report with drivers: ["constructor"] reads the inherited Object constructor here, converts it to NaN, and persists that value as null. The next relay restart rejects the entire affected day in readDay, losing all of that day's aggregates; __proto__ similarly disappears rather than being counted. Use null-prototype dictionaries or an own-property check before incrementing arbitrary validated labels.
Useful? React with 👍 / 👎.
What changed
POST /fleetfor FTW's fixed anonymous daily reportWhy
The old fleet endpoint is no longer reachable. The existing FTW relay is live and is the right place to receive the small daily report, but it must keep only useful totals and no household log.
Deploy this before the matching FTW Core beta starts sending reports.
Checks
npm run verify— 879 passed, 1 skipped; 0 Svelte errors or warnings; production build passed