From 2f8d8339c519ad2eeee34a6c76e96364c634760f Mon Sep 17 00:00:00 2001 From: Daniel McCoy Stephenson Date: Tue, 20 Oct 2026 05:02:51 -0600 Subject: [PATCH] List an overlong installation ID among the "unavailable" reasons The README's "Turning it off" list of what makes disabledReason() "unavailable" left out an explicit InstallId over 255 bytes, which the constructor rejects alongside an overlong version. Also move the json() doc comment back above json(); it sat above INSTALL_TAG instead. Co-Authored-By: Claude Opus 5.5 --- README.md | 6 +++--- trace_client.hpp | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 4c015cc..480c837 100644 --- a/README.md +++ b/README.md @@ -125,9 +125,9 @@ starts no thread and costs nothing; the first that applies is the reason: `client.disabledReason()` says which one applied — `"environment"`, `"config"` or `"no key"`, or `"unavailable"` when the client cannot send at all (a -browser build, a blank base URL, application name or version, a version over -255 bytes, or the thread could -not be started) — and is empty when the client reports, so a program can print it. +browser build, a blank base URL, application name or version, a version or +explicit installation ID over 255 bytes, or the thread could not be started) — +and is empty when the client reports, so a program can print it. A default-constructed `TraceClient` is disabled with reason `"config"`. A disabled client also never makes up or writes an [installation ID](#every-event-carries-a-random-installation-id). diff --git a/trace_client.hpp b/trace_client.hpp index 7250205..fac8349 100644 --- a/trace_client.hpp +++ b/trace_client.hpp @@ -259,10 +259,6 @@ inline std::string number(double value) { return text; } -/** - * The report body. JSON is written by hand so this file has no dependencies; - * the shape is fixed and small, three scalars and a flat string map. - */ /** The tag every event carries the installation's ID as. */ static const char *const INSTALL_TAG = "install"; @@ -350,6 +346,10 @@ inline void makeParentDirectories(const std::string &path) { } } +/** + * The report body. JSON is written by hand so this file has no dependencies; + * the shape is fixed and small, three scalars and a flat string map. + */ inline std::string json(const std::string &application, const std::string &name, bool hasValue, double value, const Tags &tags) { std::string out = "{\"application\":" + quote(cleanUtf8(application, std::string::npos));