Skip to content

Require the program version and tag every event with it; 0.4.0 - #5

Merged
dmccoystephenson merged 2 commits into
mainfrom
program-version-on-every-event
Sep 30, 2026
Merged

dmccoystephenson merged 2 commits into
mainfrom
program-version-on-every-event

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

builder(baseUrl, application, version) now requires the program's own version. Every event the client sends carries it as the tag version, including command and any other event, not only a hand-tagged startup. An event's own version tag wins. The version sits above the server-wide tags, so a server-wide version never replaces it.

Breaking (0.3.0 → 0.4.0): the two-argument builder has been removed. Upgrading means passing one more argument (in a Bukkit plugin, getDescription().getVersion()). All consumers are re-vendored in a follow-up pass.

Tests: mvn test passes, 46/46. New tests cover a command tagged with the trimmed version, an event's own version winning, the caller's map left unmodified, and a blank/overlong version being rejected. A mutation probe that removes the injection fails 10 tests.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AuTszT2gqv7nLVYrtKD4ji


drafted by Claude on behalf of Daniel Stephenson

builder(baseUrl, application, version) now takes the program's own
version, required (blank or over 255 characters throws). Every event
the client sends carries it as the tag `version` -- command events and
any other, not only a hand-tagged startup -- so each event can be tied
to a release. An event's own `version` tag wins; the program version
is placed above server-wide tags, so a server-wide `version` never
replaces it. The caller's tag map is never modified.

Breaking: the two-argument builder is gone. Upgrading is one argument
(in a Bukkit plugin, getDescription().getVersion()).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AuTszT2gqv7nLVYrtKD4ji
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AuTszT2gqv7nLVYrtKD4ji
@dmccoystephenson
dmccoystephenson merged commit cbc532a into main Sep 30, 2026
3 checks passed
dmccoystephenson added a commit to Stephenson-Software/trace-client-cpp that referenced this pull request Sep 30, 2026
* Carry the program's version on every event (0.2.0)

The constructor now takes the program's own version as a required argument
after the application name. It is trimmed and sent as the tag "version" on
every event; an event's own "version" tag wins, and the caller's tags are
never modified. A blank version, or one over 255 bytes, disables the client
with reason "unavailable", matching how a blank base URL or application name
is handled, since nothing in the client throws. The default-constructed
(disabled) client holds the placeholder version "disabled". The User-Agent
still names the client's version.

Breaking change: TRACE_CLIENT_VERSION 0.1.0 -> 0.2.0. Mirrors
Stephenson-Software/trace-client-java#5.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AuTszT2gqv7nLVYrtKD4ji

* Doc comment: the version is the constructor's third argument

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AuTszT2gqv7nLVYrtKD4ji

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant