Repository navigation
Send a random per-installation ID as the tag install (0.5.0) - #9
Merged
Merged
Conversation
Every event now carries `install`, so the trace server can count distinct servers instead of raw events. On Spigot it is the `server-id:` line of plugins/trace/config.yml: when an enabled client finds none, a UUID.randomUUID() is appended under an explanatory comment, leaving the rest of the file byte for byte. A file that cannot be read or written gives an in-memory ID for that run; build() still never throws. Programs without a server-wide config send no ID unless they pass one with Builder.installId(String). Every opt-out is checked first: a disabled client never generates, writes or sends an ID. An event's own `install` tag wins. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014ztkfamsbEqQfcu76me5SL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Every event now carries a random per-installation ID as the tag
install, so the trace server can count distinct servers ("active servers in the last 30 days") instead of raw events. Version bumped to 0.5.0 (VERSIONandpom.xml).How
server-id:key ofplugins/trace/config.yml, following bStats'serverUuidprecedent. When an enabled client finds no usableserver-id:line, aUUID.randomUUID()is appended to the file under a short comment; nothing else in the file is touched (operator text is kept byte for byte, a missing trailing newline is handled). The file is read back after the append so two clients racing on one file agree on the first line.FINE;build()never throws. A file that exists but cannot be read (e.g. not UTF-8) is deliberately not appended to, otherwise it would gain a line on every start.Builder.installId(String). Without it (and withoutserverWideConfig), noinstalltag is sent and no file is written anywhere. Blank/null means none; over 255 characters throwsIllegalArgumentExceptionfrom the setter (same as an overlongversion). An explicit ID wins overserver-id:, and the file then gains noserver-id:.disabledReason()is computed. WithTRACE_USAGE_REPORTING=off/DO_NOT_TRACK=1,enabled: false,enabled(false)or no key, no ID is generated or written.installtag wins (likeversion); theinstalltag is placed before server-widetags:entries, so atags:entry namedinstalldoes not overrideserver-id:. It is not added if the event is already atMAX_TAGS.server-id:is read at column 0, outside atags:block, first valid one wins; the value must match[A-Za-z0-9][A-Za-z0-9_.-]*and be at most 255 characters, otherwise it is ignored (and a new one appended).installId()(null when disabled or none), so a program can print it.server-id: random, identifies no person or IP address, delete the line to reset.Docs
README gains a section "Every event carries a random server ID" (what it is, where it lives, how to reset, how opt-outs stop it, non-plugin usage), the example startup log line now mentions the random server ID, the opting-out table no longer claims the file is never rewritten, and the wire-format example shows
install.Tests
mvn test: 54 tests, 0 failures (47 before). Existing exact-body tests were updated for the new tag (thewriteServerWideConfigtest helper now appends a fixedserver-id: test-server). New tests:server-id:parsing (quoted, first wins, invalid ignored, column 0 only, insidetags:is a tag)enabled: false,enabled(false), no key) → no ID, file untouched / not createdinstallId(...), blank/null/overlong, explicit wins over fileinstalltag winsA mutation probe (resolving the ID regardless of
disabledReason) fails 2 tests.Downstream
The server side should count distinct values of the
installtag. Vendored copies in plugins are unchanged until they are re-vendored to 0.5.0; no plugin repo is touched here.🤖 Generated with Claude Code
https://claude.ai/code/session_014ztkfamsbEqQfcu76me5SL
drafted by Claude on behalf of Daniel Stephenson