-
Notifications
You must be signed in to change notification settings - Fork 821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: make TraceState immutable #1597
fix: make TraceState immutable #1597
Conversation
Spec requires that TraceState is immutable. Adapt TraceState API to return a TraceState for set/unset. Adapt implementation of set/unset to clone the TraceState before mutating and return the cloned TraceState.
0a0c5fe
to
5e412ac
Compare
Codecov Report
@@ Coverage Diff @@
## master #1597 +/- ##
==========================================
+ Coverage 91.18% 91.19% +0.01%
==========================================
Files 164 164
Lines 5024 5033 +9
Branches 1026 1026
==========================================
+ Hits 4581 4590 +9
Misses 443 443
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am surprised only 3 files need to change. Is tracestate never updated anywhere?
I was also surprised. Seems noone is using it. This explains that it was not noticed that it is not spec conform. |
@@ -25,30 +25,30 @@ describe('TraceState', () => { | |||
}); | |||
|
|||
it('must replace keys and move them to the front', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we should update the description and mention that, "creates a new tracestate and replace..." WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Which problem is this PR solving?
Spec requires that TraceState is immutable.
Fixes: #1596
Short description of the changes
Adapt TraceState API to return a TraceState for set/unset.
Adapt implementation of set/unset to clone the TraceState before mutating and return the cloned TraceState.