Skip to content

B116: automatic active count - #75

Merged
westernCasa merged 1 commit into
mainfrom
feat/active-count
Nov 9, 2026
Merged

westernCasa merged 1 commit into
mainfrom
feat/active-count

Conversation

@westernCasa

Copy link
Copy Markdown
Owner

B116. Automatic active count, in 0.11.0 before the tag.

What NODE sends

  • Once a day while NODE is in use (window focused, input in the last two minutes), one request: { "v": "0.11.0", "os": "mac", "w": true, "m": true }.
  • w and m say whether this is the first count this week and this month. That's how weekly and monthly users get counted without any id.
  • Nothing else: no id, pages, addresses or keywords. Node's fetch, so no cookies or browser session.
  • Installed copies only. npm start and test runs send nothing, unless a test sets NODE_ACTIVE_API.
  • NODE keeps only the day, week and month of the last count it sent. A failed send is tried again later; the user never sees an error.

Where it's said (on by default, no prompt, as the backlog row says)

  • Welcome screen: "NODE sends one anonymous count a day: its version and your operating system, nothing else. Turn it off in Settings → Help."
  • Settings → Help: Send one anonymous count a day, with what it sends. Saved with the Save button, like the other settings there.
  • 0.11.0 release notes: at the top, and in a new "What NODE sends" section.
  • README "What NODE sends": a new row, and the "sends no usage data" sentence changed.
  • The privacy page (B74) isn't built yet; the switch goes there when it is.

The server (the share Worker, same Cloudflare account)

  • POST /api/active checks the shape and stores one empty R2 object: a/<day>/<os>/<version>/<marks>/<random>.
  • No address is stored. It's used only for a limit of 5 counts a minute, in memory. Observability stays off.
  • A new R2 rule deletes counts after 400 days.
  • GET /api/active?days=30 gives counts per day (by OS and version), per ISO week and per month. It needs a token: add a repository secret NODE_STATS_TOKEN (any long random text) and the deploy workflow sets it on the Worker. Without it, nobody can read the counts.
  • Merging this deploys the Worker (the deploy workflow runs on changes to worker/).

Tests

  • test/active-count-demo.js (npm run test:active, in test:unit).
  • 4 more checks in test/share-worker-demo.js.
  • New test/e2e/55-active-count.js (11 checks), in both CI e2e lists.
  • Locally: test:unit, and e2e 01, 20, 23, 40 and 41 still pass.

Generated by Claude Code

Once a day while NODE is in use, installed copies send one request with
NODE's version, the OS and whether it is the first count this week and
this month. No id, pages, addresses or keywords. On by default, said on
the welcome screen and in the 0.11.0 notes, off in Settings → Help. The
share Worker stores one empty object per count (no address), deletes them
after 400 days, and serves the counts with a token.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011V7Bv7WZ9Q92MZoNWYwevQ
@westernCasa
westernCasa merged commit b25e58f into main Nov 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants