From a2fce7072f16c1edd047d6bb2fe2097b674823cd Mon Sep 17 00:00:00 2001 From: Daniel McCoy Stephenson Date: Mon, 16 Nov 2026 02:13:36 -0700 Subject: [PATCH] Test that a None install tag does not suppress the installation ID report() drops None-valued tags before adding install, so an event passing install=None still carries the client's ID, as one passing version=None still carries the program version. Nothing guarded that order: merging install before dropping None tags would silently send no install tag. Co-Authored-By: Claude Opus 5.5 --- tests/test_trace_client.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_trace_client.py b/tests/test_trace_client.py index 1c72743..bb137c0 100644 --- a/tests/test_trace_client.py +++ b/tests/test_trace_client.py @@ -942,6 +942,15 @@ def test_an_events_own_install_tag_wins(self): self.assertEqual({"install": "theirs", "version": "1.2.3"}, self._sent_tags(client, tags=tags)) self.assertEqual({"install": "theirs"}, tags, "the caller's tags are never modified") + def test_a_none_install_tag_does_not_suppress_the_installation_id(self): + client = TraceClient(self.base_url, "MyGame", "1.2.3", key="k", install_id="mine") + self.assertEqual({"version": "1.2.3", "install": "mine"}, self._sent_tags(client, tags={"install": None}), + "a None tag is left out, so the client's own ID takes its place, as with version") + self.capture.arrived.clear() + client = TraceClient(self.base_url, "MyGame", "1.2.3", key="k", install_id="mine") + self.assertEqual({"version": "1.2.3", "install": "7"}, self._sent_tags(client, tags={"install": 7}), + "any other value is the event's own, sent as a string, and wins") + def test_install_tag_never_pushes_an_event_past_the_tag_cap(self): client = TraceClient(self.base_url, "MyGame", "1.2.3", key="k", install_id="mine") full = {"t%d" % i: "v" for i in range(MAX_TAGS - 1)} # plus version = MAX_TAGS