From d0a78ea60c15a14b9058260357a4048fc066ff58 Mon Sep 17 00:00:00 2001 From: Daniel McCoy Stephenson Date: Sun, 15 Nov 2026 00:45:02 -0700 Subject: [PATCH] Pin that an event's own tags are not capped The README and the MAX_TAGS TSDoc say the cap only holds back the install tag and that an event's own tags are not capped, but only the 31/30 boundary was tested. The new test sends 40 own tags and checks that all of them and version arrive, without install. No behavior changed. Co-Authored-By: Claude Opus 5.5 --- tests/trace-client.test.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/trace-client.test.ts b/tests/trace-client.test.ts index a5a56b2..f6d2898 100644 --- a/tests/trace-client.test.ts +++ b/tests/trace-client.test.ts @@ -1184,6 +1184,19 @@ describe("installation ID", () => { await client.close(); }); + it("sends every one of an event's own tags past the cap, plus version, without the install tag", async () => { + const client = new TraceClient(baseUrl, "MyGame", { version: "1.0", key: "k", installId: "mine" }); + const many: Record = {}; + for (let i = 0; i < TraceClient.MAX_TAGS + 8; i++) many["t" + i] = String(i); + await client.report("many", { tags: many }); + const sent = tagsOf(0); + assert.equal(Object.keys(sent).length, TraceClient.MAX_TAGS + 9, "an event's own tags are not capped"); + for (const [key, value] of Object.entries(many)) assert.equal(sent[key], value); + assert.equal(sent.version, "1.0", "the version tag is added whatever the count"); + assert.equal(sent.install, undefined, "only the install tag is held back by the cap"); + await client.close(); + }); + it("keeps the ID in memory where the runtime has no getBuiltinModule", () => { const file = join(dir, "install-id"); const original = process.getBuiltinModule;