You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A repeated tag key is sent twice and counted twice #31
Report takes its tags as IEnumerable<KeyValuePair<string, string>>, so a list can repeat a key. Json writes every pair it is given (src/TraceClient/TraceClient.cs, the foreach over tags), and no step merges them. Two pairs with the key k are sent as:
RFC 8259 says object member names SHOULD be unique and that behaviour on duplicates is unpredictable. Each repeated pair also counts toward MaxTags, so a list of 33 identical pairs is dropped as more than 32 tags, although it holds one distinct key.
A Dictionary cannot produce this, so only programs passing a list or an array are affected. WithVersion and WithInstall also stop at presence: a list that repeats version is sent with both values.
Current behaviour is pinned by Json_WritesARepeatedTagKeyOncePerPairAndCountsEach, added in #30.
Why this is a decision, not an auto-fix
Any change alters what goes on the wire, so the dev loop treats it as a contract change. These points need a maintainer's answer:
Should a repeated key be merged, and if so, should the first or the last value win? version and install already follow "the event's own tag wins", which does not settle the order among an event's own tags.
Is it enough to document this, given that the comment above Json calls the tags a flat string map?
The trace server's handling of a duplicate key was not inspected. The Java and Python clients were not inspected either, though both are expected to take a map, which cannot repeat a key.
Activity